﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Globalization;
using System.Data;
using System.Data.Common;
using System.Xml;
using System.Text;
using LibHuman;

namespace Human
{
	/// <summary>
	/// Summary description for frmDoanTheSua.
	/// </summary>
	public class frmDoanThe : System.Windows.Forms.Form
	{
		 bool chon=false;
		 string dang_h;
		 string cb_h;
		 string doan_h;
		 string cd_h;
		private string TSo="",m_user="",sql="";		

		private AccessData  mDB=new AccessData ();
        Language lan = new Language();
		 DataSet ds =new DataSet();
		
		private DataSet ds1=new DataSet();
		private bool bClear=true,admin=false;
        private string v_manv, v_ho, v_bophan;
        private System.Windows.Forms.TextBox txtST2_DT;
        private System.Windows.Forms.TextBox txtDoan_DT;
        private System.Windows.Forms.TextBox txtST1_DT;
        private System.Windows.Forms.TextBox txtCD_DT;
        private System.Windows.Forms.ComboBox cboDTCT_DT;
		private System.Windows.Forms.TextBox txtSTD_DT;
        private System.Windows.Forms.TextBox txtDang_DT;
		private System.Windows.Forms.ComboBox cboNG_DT;
		private System.Windows.Forms.ComboBox cboTPBT_DT;
		private System.Windows.Forms.ComboBox cboTPXT_DT;
		private System.Windows.Forms.Label label146;
		private System.Windows.Forms.Label label145;
		private System.Windows.Forms.Label label144;
		private System.Windows.Forms.Label label140;
		private System.Windows.Forms.Label label141;
		private System.Windows.Forms.Label label143;
		private System.Windows.Forms.Label label142;
		private System.Windows.Forms.Label label139;
		private System.Windows.Forms.Label label138;
		private System.Windows.Forms.Label label132;
		private System.Windows.Forms.Label label134;
		private System.Windows.Forms.Label label131;
		private System.Windows.Forms.Label label129;
		private System.Windows.Forms.Label label135;
		private System.Windows.Forms.Label label137;
		private System.Windows.Forms.Label label127;
		private System.Windows.Forms.Label label125;
		private System.Windows.Forms.Label label133;
		private System.Windows.Forms.Label label128;
		private System.Windows.Forms.Label label124;
		private System.Windows.Forms.Label label136;
		private System.Windows.Forms.Label label130;
		private System.Windows.Forms.Label label126;
        private System.Windows.Forms.Label label123;
		private System.Windows.Forms.Label label152;
		private System.Windows.Forms.Label label153;
		private System.Windows.Forms.Label label154;
		private System.Windows.Forms.Label label151;
		private System.Windows.Forms.Label label150;
		private System.Windows.Forms.Label label149;
		private System.Windows.Forms.Label label147;
		private System.Windows.Forms.Label label148;
		private System.Windows.Forms.TextBox txtTSo;
		private System.Windows.Forms.Label label27;
		private System.Windows.Forms.Panel panButLyLich;
		private System.Windows.Forms.Button butThem;
		private System.Windows.Forms.Button butHuy;
		private System.Windows.Forms.Button butKetThuc;
		private MaskedBox.MaskedBox dtpNgayCongTac;
		private MaskedBox.MaskedBox dtpNgayCapCMND;
		private MaskedBox.MaskedBox dtpNgaySinh;
        private Label lblTenPhongCT;
        private Label lblHoTenNVCT;
        private Label label29;
        private Label label28;
        private Label lblMasoNVCT;
        private ToolStrip toolStrip3;
        private ToolStripLabel lblHD;
        private MaskedTextBox txtNTGCM_DT;
        private MaskedTextBox txtNTL_DT;
        private MaskedTextBox txtNDB_DT;
        private MaskedTextBox txtNCT_DT;
        private MaskedTextBox txtNTN_DT;
        private MaskedTextBox txtNCD_DT;
        private MaskedTextBox txtCDP_DT;
        private MaskedTextBox txtNKN_DT;
        private MaskedTextBox txtNVD_DT;
        private MaskedTextBox txtDP_DT;
        private MaskedTextBox txtNCDen_DT;
        private Button butEdit;
        private GroupBox group;
        private Label label1;
        private TextBox txtNoiCD_DT;
        private MaskedTextBox txtNCDi_DT;
        private Label label3;
        private Label label2;
        private TextBox txtnoiCDi_DT;
        private ToolTip toolTip1;
        private ComboBox cbo_chibodt;
        private ComboBox cbo_todoan;
        private ComboBox cbo_tocdoan;
        private ComboBox cbo_doanthecvht;
        private ComboBox cbo_cqcvvq;
        private ComboBox cbo_dagcvht;
        private ComboBox cbo_doanthecvvq;
        private ComboBox cbo_dagcvvq;
        private ComboBox cbo_cqcvht;
        private IContainer components;
		
		public frmDoanThe(string manv,string hoten,string madv,bool m_admin)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            m_user = mDB.user;
			if (Screen.PrimaryScreen.WorkingArea.Width>=1000)//
			{
				this.WindowState=FormWindowState.Normal;
				this.MaximizeBox=false;
			}
			else
			{
				//this.BackgroundImage = lbl800.Image;
				this.WindowState=FormWindowState.Maximized;
			}
			lblMasoNVCT.Text=manv;
			lblHoTenNVCT.Text=hoten;
			lblTenPhongCT.Text=madv;			
			load_LBL(manv,hoten,madv);
			tongso();
            admin = m_admin;
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDoanThe));
            this.txtST2_DT = new System.Windows.Forms.TextBox();
            this.txtDoan_DT = new System.Windows.Forms.TextBox();
            this.txtST1_DT = new System.Windows.Forms.TextBox();
            this.txtCD_DT = new System.Windows.Forms.TextBox();
            this.cboDTCT_DT = new System.Windows.Forms.ComboBox();
            this.txtSTD_DT = new System.Windows.Forms.TextBox();
            this.txtDang_DT = new System.Windows.Forms.TextBox();
            this.cboNG_DT = new System.Windows.Forms.ComboBox();
            this.cboTPBT_DT = new System.Windows.Forms.ComboBox();
            this.cboTPXT_DT = new System.Windows.Forms.ComboBox();
            this.label146 = new System.Windows.Forms.Label();
            this.label145 = new System.Windows.Forms.Label();
            this.label144 = new System.Windows.Forms.Label();
            this.label140 = new System.Windows.Forms.Label();
            this.label141 = new System.Windows.Forms.Label();
            this.label143 = new System.Windows.Forms.Label();
            this.label142 = new System.Windows.Forms.Label();
            this.label139 = new System.Windows.Forms.Label();
            this.label138 = new System.Windows.Forms.Label();
            this.label132 = new System.Windows.Forms.Label();
            this.label134 = new System.Windows.Forms.Label();
            this.label131 = new System.Windows.Forms.Label();
            this.label129 = new System.Windows.Forms.Label();
            this.label135 = new System.Windows.Forms.Label();
            this.label137 = new System.Windows.Forms.Label();
            this.label127 = new System.Windows.Forms.Label();
            this.label125 = new System.Windows.Forms.Label();
            this.label133 = new System.Windows.Forms.Label();
            this.label128 = new System.Windows.Forms.Label();
            this.label124 = new System.Windows.Forms.Label();
            this.label136 = new System.Windows.Forms.Label();
            this.label130 = new System.Windows.Forms.Label();
            this.label126 = new System.Windows.Forms.Label();
            this.label123 = new System.Windows.Forms.Label();
            this.label152 = new System.Windows.Forms.Label();
            this.label153 = new System.Windows.Forms.Label();
            this.label154 = new System.Windows.Forms.Label();
            this.label151 = new System.Windows.Forms.Label();
            this.label150 = new System.Windows.Forms.Label();
            this.label149 = new System.Windows.Forms.Label();
            this.label147 = new System.Windows.Forms.Label();
            this.label148 = new System.Windows.Forms.Label();
            this.txtTSo = new System.Windows.Forms.TextBox();
            this.label27 = new System.Windows.Forms.Label();
            this.panButLyLich = new System.Windows.Forms.Panel();
            this.butEdit = new System.Windows.Forms.Button();
            this.butThem = new System.Windows.Forms.Button();
            this.butHuy = new System.Windows.Forms.Button();
            this.butKetThuc = new System.Windows.Forms.Button();
            this.dtpNgayCongTac = new MaskedBox.MaskedBox();
            this.dtpNgayCapCMND = new MaskedBox.MaskedBox();
            this.dtpNgaySinh = new MaskedBox.MaskedBox();
            this.lblTenPhongCT = new System.Windows.Forms.Label();
            this.lblHoTenNVCT = new System.Windows.Forms.Label();
            this.label29 = new System.Windows.Forms.Label();
            this.label28 = new System.Windows.Forms.Label();
            this.lblMasoNVCT = new System.Windows.Forms.Label();
            this.toolStrip3 = new System.Windows.Forms.ToolStrip();
            this.lblHD = new System.Windows.Forms.ToolStripLabel();
            this.txtNTGCM_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNTL_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNDB_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNCT_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNTN_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNCD_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtCDP_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNKN_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNVD_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtDP_DT = new System.Windows.Forms.MaskedTextBox();
            this.txtNCDen_DT = new System.Windows.Forms.MaskedTextBox();
            this.group = new System.Windows.Forms.GroupBox();
            this.cbo_cqcvht = new System.Windows.Forms.ComboBox();
            this.cbo_doanthecvht = new System.Windows.Forms.ComboBox();
            this.cbo_cqcvvq = new System.Windows.Forms.ComboBox();
            this.cbo_dagcvht = new System.Windows.Forms.ComboBox();
            this.cbo_doanthecvvq = new System.Windows.Forms.ComboBox();
            this.cbo_dagcvvq = new System.Windows.Forms.ComboBox();
            this.cbo_todoan = new System.Windows.Forms.ComboBox();
            this.cbo_tocdoan = new System.Windows.Forms.ComboBox();
            this.cbo_chibodt = new System.Windows.Forms.ComboBox();
            this.txtNCDi_DT = new System.Windows.Forms.MaskedTextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.txtnoiCDi_DT = new System.Windows.Forms.TextBox();
            this.txtNoiCD_DT = new System.Windows.Forms.TextBox();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.panButLyLich.SuspendLayout();
            this.toolStrip3.SuspendLayout();
            this.group.SuspendLayout();
            this.SuspendLayout();
            // 
            // txtST2_DT
            // 
            this.txtST2_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtST2_DT.Location = new System.Drawing.Point(329, 244);
            this.txtST2_DT.MaxLength = 10;
            this.txtST2_DT.Name = "txtST2_DT";
            this.txtST2_DT.Size = new System.Drawing.Size(80, 22);
            this.txtST2_DT.TabIndex = 23;
            this.txtST2_DT.WordWrap = false;
            this.txtST2_DT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtST2_DT_KeyPress);
            this.txtST2_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtST2_DT_KeyDown);
            // 
            // txtDoan_DT
            // 
            this.txtDoan_DT.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtDoan_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtDoan_DT.Location = new System.Drawing.Point(72, 245);
            this.txtDoan_DT.MaxLength = 1;
            this.txtDoan_DT.Name = "txtDoan_DT";
            this.txtDoan_DT.Size = new System.Drawing.Size(33, 22);
            this.txtDoan_DT.TabIndex = 21;
            this.txtDoan_DT.WordWrap = false;
            this.txtDoan_DT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDoan_DT_KeyPress);
            this.txtDoan_DT.Validated += new System.EventHandler(this.txtDoan_DT_Validated);
            this.txtDoan_DT.TextChanged += new System.EventHandler(this.txtDoan_DT_TextChanged);
            this.txtDoan_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDoan_DT_KeyDown);
            // 
            // txtST1_DT
            // 
            this.txtST1_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtST1_DT.Location = new System.Drawing.Point(329, 219);
            this.txtST1_DT.MaxLength = 10;
            this.txtST1_DT.Name = "txtST1_DT";
            this.txtST1_DT.Size = new System.Drawing.Size(80, 22);
            this.txtST1_DT.TabIndex = 18;
            this.txtST1_DT.WordWrap = false;
            this.txtST1_DT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtST1_DT_KeyPress);
            this.txtST1_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtST1_DT_KeyDown);
            // 
            // txtCD_DT
            // 
            this.txtCD_DT.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtCD_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtCD_DT.Location = new System.Drawing.Point(72, 220);
            this.txtCD_DT.MaxLength = 1;
            this.txtCD_DT.Name = "txtCD_DT";
            this.txtCD_DT.Size = new System.Drawing.Size(33, 22);
            this.txtCD_DT.TabIndex = 16;
            this.txtCD_DT.WordWrap = false;
            this.txtCD_DT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCD_DT_KeyPress);
            this.txtCD_DT.Validated += new System.EventHandler(this.txtCD_DT_Validated);
            this.txtCD_DT.TextChanged += new System.EventHandler(this.txtCD_DT_TextChanged);
            this.txtCD_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCD_DT_KeyDown);
            // 
            // cboDTCT_DT
            // 
            this.cboDTCT_DT.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboDTCT_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboDTCT_DT.Location = new System.Drawing.Point(117, 157);
            this.cboDTCT_DT.Name = "cboDTCT_DT";
            this.cboDTCT_DT.Size = new System.Drawing.Size(103, 24);
            this.cboDTCT_DT.TabIndex = 10;
            this.cboDTCT_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboDTCT_DT_KeyDown);
            // 
            // txtSTD_DT
            // 
            this.txtSTD_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSTD_DT.Location = new System.Drawing.Point(483, 79);
            this.txtSTD_DT.MaxLength = 10;
            this.txtSTD_DT.Name = "txtSTD_DT";
            this.txtSTD_DT.Size = new System.Drawing.Size(81, 22);
            this.txtSTD_DT.TabIndex = 7;
            this.txtSTD_DT.WordWrap = false;
            this.txtSTD_DT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSTD_DT_KeyPress);
            this.txtSTD_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSTD_DT_KeyDown);
            // 
            // txtDang_DT
            // 
            this.txtDang_DT.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtDang_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtDang_DT.Location = new System.Drawing.Point(117, 83);
            this.txtDang_DT.MaxLength = 1;
            this.txtDang_DT.Name = "txtDang_DT";
            this.txtDang_DT.Size = new System.Drawing.Size(33, 22);
            this.txtDang_DT.TabIndex = 5;
            this.txtDang_DT.WordWrap = false;
            this.txtDang_DT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDang_DT_KeyPress);
            this.txtDang_DT.Validated += new System.EventHandler(this.txtDang_DT_Validated);
            this.txtDang_DT.TextChanged += new System.EventHandler(this.txtDang_DT_TextChanged);
            this.txtDang_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDang_DT_KeyDown);
            // 
            // cboNG_DT
            // 
            this.cboNG_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboNG_DT.Location = new System.Drawing.Point(117, 41);
            this.cboNG_DT.Name = "cboNG_DT";
            this.cboNG_DT.Size = new System.Drawing.Size(103, 24);
            this.cboNG_DT.TabIndex = 2;
            this.cboNG_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboNG_DT_KeyDown);
            // 
            // cboTPBT_DT
            // 
            this.cboTPBT_DT.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTPBT_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboTPBT_DT.Location = new System.Drawing.Point(483, 16);
            this.cboTPBT_DT.Name = "cboTPBT_DT";
            this.cboTPBT_DT.Size = new System.Drawing.Size(194, 24);
            this.cboTPBT_DT.TabIndex = 1;
            this.cboTPBT_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboTPBT_DT_KeyDown);
            // 
            // cboTPXT_DT
            // 
            this.cboTPXT_DT.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTPXT_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboTPXT_DT.Location = new System.Drawing.Point(117, 16);
            this.cboTPXT_DT.Name = "cboTPXT_DT";
            this.cboTPXT_DT.Size = new System.Drawing.Size(168, 24);
            this.cboTPXT_DT.TabIndex = 0;
            this.cboTPXT_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboTPXT_DT_KeyDown);
            // 
            // label146
            // 
            this.label146.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label146.ForeColor = System.Drawing.Color.DarkBlue;
            this.label146.Location = new System.Drawing.Point(628, 275);
            this.label146.Name = "label146";
            this.label146.Size = new System.Drawing.Size(55, 13);
            this.label146.TabIndex = 215;
            this.label146.Text = "Đoàn phí ";
            this.label146.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label145
            // 
            this.label145.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label145.ForeColor = System.Drawing.Color.DarkBlue;
            this.label145.Location = new System.Drawing.Point(409, 250);
            this.label145.Name = "label145";
            this.label145.Size = new System.Drawing.Size(84, 13);
            this.label145.TabIndex = 214;
            this.label145.Text = "Ngày vào đoàn ";
            this.label145.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label144
            // 
            this.label144.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label144.ForeColor = System.Drawing.Color.DarkBlue;
            this.label144.Location = new System.Drawing.Point(601, 225);
            this.label144.Name = "label144";
            this.label144.Size = new System.Drawing.Size(82, 13);
            this.label144.TabIndex = 213;
            this.label144.Text = "Công đoàn phí ";
            this.label144.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label140
            // 
            this.label140.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label140.ForeColor = System.Drawing.Color.DarkBlue;
            this.label140.Location = new System.Drawing.Point(286, 250);
            this.label140.Name = "label140";
            this.label140.Size = new System.Drawing.Size(41, 13);
            this.label140.TabIndex = 209;
            this.label140.Text = "Số thẻ ";
            this.label140.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label141
            // 
            this.label141.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label141.ForeColor = System.Drawing.Color.DarkBlue;
            this.label141.Location = new System.Drawing.Point(295, 194);
            this.label141.Name = "label141";
            this.label141.Size = new System.Drawing.Size(95, 13);
            this.label141.TabIndex = 210;
            this.label141.Text = "Ngày chuyển đến ";
            this.label141.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label143
            // 
            this.label143.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label143.ForeColor = System.Drawing.Color.DarkBlue;
            this.label143.Location = new System.Drawing.Point(300, 123);
            this.label143.Name = "label143";
            this.label143.Size = new System.Drawing.Size(90, 13);
            this.label143.TabIndex = 212;
            this.label143.Text = "Ngày chính thức ";
            this.label143.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label142
            // 
            this.label142.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label142.ForeColor = System.Drawing.Color.DarkBlue;
            this.label142.Location = new System.Drawing.Point(571, 46);
            this.label142.Name = "label142";
            this.label142.Size = new System.Drawing.Size(72, 13);
            this.label142.TabIndex = 211;
            this.label142.Text = "Ngày thoát ly ";
            this.label142.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label139
            // 
            this.label139.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label139.ForeColor = System.Drawing.Color.DarkBlue;
            this.label139.Location = new System.Drawing.Point(285, 224);
            this.label139.Name = "label139";
            this.label139.Size = new System.Drawing.Size(41, 13);
            this.label139.TabIndex = 208;
            this.label139.Text = "Số thẻ ";
            this.label139.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label138
            // 
            this.label138.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label138.ForeColor = System.Drawing.Color.DarkBlue;
            this.label138.Location = new System.Drawing.Point(111, 225);
            this.label138.Name = "label138";
            this.label138.Size = new System.Drawing.Size(26, 13);
            this.label138.TabIndex = 207;
            this.label138.Text = "Tổ :";
            this.label138.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label132
            // 
            this.label132.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label132.ForeColor = System.Drawing.Color.DarkBlue;
            this.label132.Location = new System.Drawing.Point(24, 166);
            this.label132.Name = "label132";
            this.label132.Size = new System.Drawing.Size(90, 13);
            this.label132.TabIndex = 204;
            this.label132.Text = "Đào tạo chính trị ";
            this.label132.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label134
            // 
            this.label134.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label134.ForeColor = System.Drawing.Color.DarkBlue;
            this.label134.Location = new System.Drawing.Point(418, 224);
            this.label134.Name = "label134";
            this.label134.Size = new System.Drawing.Size(74, 13);
            this.label134.TabIndex = 202;
            this.label134.Text = "Ngày kết nạp ";
            this.label134.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label131
            // 
            this.label131.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label131.ForeColor = System.Drawing.Color.DarkBlue;
            this.label131.Location = new System.Drawing.Point(412, 84);
            this.label131.Name = "label131";
            this.label131.Size = new System.Drawing.Size(69, 13);
            this.label131.TabIndex = 205;
            this.label131.Text = "Số thẻ đảng ";
            this.label131.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label129
            // 
            this.label129.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label129.ForeColor = System.Drawing.Color.DarkBlue;
            this.label129.Location = new System.Drawing.Point(588, 249);
            this.label129.Name = "label129";
            this.label129.Size = new System.Drawing.Size(95, 13);
            this.label129.TabIndex = 198;
            this.label129.Text = "Ngày chuyển đến ";
            this.label129.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label135
            // 
            this.label135.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label135.ForeColor = System.Drawing.Color.DarkBlue;
            this.label135.Location = new System.Drawing.Point(305, 163);
            this.label135.Name = "label135";
            this.label135.Size = new System.Drawing.Size(85, 13);
            this.label135.TabIndex = 201;
            this.label135.Text = "Ngày tốt nghiệp ";
            this.label135.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label137
            // 
            this.label137.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label137.ForeColor = System.Drawing.Color.DarkBlue;
            this.label137.Location = new System.Drawing.Point(111, 250);
            this.label137.Name = "label137";
            this.label137.Size = new System.Drawing.Size(26, 13);
            this.label137.TabIndex = 206;
            this.label137.Text = "Tổ :";
            this.label137.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label127
            // 
            this.label127.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label127.ForeColor = System.Drawing.Color.DarkBlue;
            this.label127.Location = new System.Drawing.Point(161, 88);
            this.label127.Name = "label127";
            this.label127.Size = new System.Drawing.Size(40, 13);
            this.label127.TabIndex = 197;
            this.label127.Text = "Chi bộ ";
            this.label127.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label125
            // 
            this.label125.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label125.ForeColor = System.Drawing.Color.DarkBlue;
            this.label125.Location = new System.Drawing.Point(34, 250);
            this.label125.Name = "label125";
            this.label125.Size = new System.Drawing.Size(36, 13);
            this.label125.TabIndex = 195;
            this.label125.Text = "Đoàn ";
            this.label125.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label133
            // 
            this.label133.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label133.ForeColor = System.Drawing.Color.DarkBlue;
            this.label133.Location = new System.Drawing.Point(53, 123);
            this.label133.Name = "label133";
            this.label133.Size = new System.Drawing.Size(61, 13);
            this.label133.TabIndex = 203;
            this.label133.Text = "Ngày dự bị ";
            this.label133.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label128
            // 
            this.label128.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label128.ForeColor = System.Drawing.Color.DarkBlue;
            this.label128.Location = new System.Drawing.Point(78, 88);
            this.label128.Name = "label128";
            this.label128.Size = new System.Drawing.Size(36, 13);
            this.label128.TabIndex = 196;
            this.label128.Text = "Đảng ";
            this.label128.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label124
            // 
            this.label124.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label124.ForeColor = System.Drawing.Color.DarkBlue;
            this.label124.Location = new System.Drawing.Point(51, 46);
            this.label124.Name = "label124";
            this.label124.Size = new System.Drawing.Size(63, 13);
            this.label124.TabIndex = 193;
            this.label124.Text = "Nguồn gốc ";
            this.label124.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label136
            // 
            this.label136.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label136.ForeColor = System.Drawing.Color.DarkBlue;
            this.label136.Location = new System.Drawing.Point(361, 40);
            this.label136.Name = "label136";
            this.label136.Size = new System.Drawing.Size(120, 24);
            this.label136.TabIndex = 200;
            this.label136.Text = "Ngày tham gia CM ";
            this.label136.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label130
            // 
            this.label130.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label130.ForeColor = System.Drawing.Color.DarkBlue;
            this.label130.Location = new System.Drawing.Point(385, 16);
            this.label130.Name = "label130";
            this.label130.Size = new System.Drawing.Size(96, 24);
            this.label130.TabIndex = 199;
            this.label130.Text = "TP . Bản thân ";
            this.label130.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label126
            // 
            this.label126.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label126.ForeColor = System.Drawing.Color.DarkBlue;
            this.label126.Location = new System.Drawing.Point(8, 225);
            this.label126.Name = "label126";
            this.label126.Size = new System.Drawing.Size(63, 13);
            this.label126.TabIndex = 194;
            this.label126.Text = "Công đoàn ";
            this.label126.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label123
            // 
            this.label123.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label123.ForeColor = System.Drawing.Color.DarkBlue;
            this.label123.Location = new System.Drawing.Point(18, 16);
            this.label123.Name = "label123";
            this.label123.Size = new System.Drawing.Size(96, 24);
            this.label123.TabIndex = 192;
            this.label123.Text = "TP . Xuất thân ";
            this.label123.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label152
            // 
            this.label152.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label152.ForeColor = System.Drawing.Color.DarkBlue;
            this.label152.Location = new System.Drawing.Point(555, 338);
            this.label152.Name = "label152";
            this.label152.Size = new System.Drawing.Size(47, 14);
            this.label152.TabIndex = 247;
            this.label152.Text = "Cơ quan";
            this.label152.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label153
            // 
            this.label153.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label153.ForeColor = System.Drawing.Color.DarkBlue;
            this.label153.Location = new System.Drawing.Point(336, 340);
            this.label153.Name = "label153";
            this.label153.Size = new System.Drawing.Size(52, 13);
            this.label153.TabIndex = 246;
            this.label153.Text = "Đoàn thể ";
            this.label153.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label154
            // 
            this.label154.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label154.ForeColor = System.Drawing.Color.DarkBlue;
            this.label154.Location = new System.Drawing.Point(143, 339);
            this.label154.Name = "label154";
            this.label154.Size = new System.Drawing.Size(36, 13);
            this.label154.TabIndex = 245;
            this.label154.Text = "Đảng ";
            this.label154.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label151
            // 
            this.label151.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label151.ForeColor = System.Drawing.Color.DarkBlue;
            this.label151.Location = new System.Drawing.Point(543, 310);
            this.label151.Name = "label151";
            this.label151.Size = new System.Drawing.Size(59, 13);
            this.label151.TabIndex = 244;
            this.label151.Text = "Cơ quan";
            this.label151.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label150
            // 
            this.label150.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label150.ForeColor = System.Drawing.Color.DarkBlue;
            this.label150.Location = new System.Drawing.Point(332, 311);
            this.label150.Name = "label150";
            this.label150.Size = new System.Drawing.Size(58, 13);
            this.label150.TabIndex = 243;
            this.label150.Text = "Đoàn thể ";
            this.label150.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label149
            // 
            this.label149.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label149.ForeColor = System.Drawing.Color.DarkBlue;
            this.label149.Location = new System.Drawing.Point(143, 311);
            this.label149.Name = "label149";
            this.label149.Size = new System.Drawing.Size(36, 13);
            this.label149.TabIndex = 242;
            this.label149.Text = "Đảng ";
            this.label149.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label147
            // 
            this.label147.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label147.ForeColor = System.Drawing.Color.MediumBlue;
            this.label147.Location = new System.Drawing.Point(0, 311);
            this.label147.Name = "label147";
            this.label147.Size = new System.Drawing.Size(133, 24);
            this.label147.TabIndex = 240;
            this.label147.Text = "Chức vụ vừa qua ";
            this.label147.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label148
            // 
            this.label148.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label148.ForeColor = System.Drawing.Color.MediumBlue;
            this.label148.Location = new System.Drawing.Point(3, 334);
            this.label148.Name = "label148";
            this.label148.Size = new System.Drawing.Size(130, 24);
            this.label148.TabIndex = 241;
            this.label148.Text = "Chức vụ hiện tại ";
            this.label148.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txtTSo
            // 
            this.txtTSo.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtTSo.ForeColor = System.Drawing.Color.Red;
            this.txtTSo.Location = new System.Drawing.Point(79, 476);
            this.txtTSo.Name = "txtTSo";
            this.txtTSo.ReadOnly = true;
            this.txtTSo.Size = new System.Drawing.Size(64, 22);
            this.txtTSo.TabIndex = 30;
            this.txtTSo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.txtTSo.Visible = false;
            this.txtTSo.WordWrap = false;
            // 
            // label27
            // 
            this.label27.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label27.ForeColor = System.Drawing.Color.Blue;
            this.label27.Location = new System.Drawing.Point(15, 481);
            this.label27.Name = "label27";
            this.label27.Size = new System.Drawing.Size(56, 19);
            this.label27.TabIndex = 256;
            this.label27.Text = "Tổng Số ";
            this.label27.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.label27.Visible = false;
            // 
            // panButLyLich
            // 
            this.panButLyLich.Controls.Add(this.butEdit);
            this.panButLyLich.Controls.Add(this.butThem);
            this.panButLyLich.Controls.Add(this.butHuy);
            this.panButLyLich.Controls.Add(this.butKetThuc);
            this.panButLyLich.Location = new System.Drawing.Point(213, 470);
            this.panButLyLich.Name = "panButLyLich";
            this.panButLyLich.Size = new System.Drawing.Size(364, 41);
            this.panButLyLich.TabIndex = 34;
            // 
            // butEdit
            // 
            this.butEdit.BackColor = System.Drawing.SystemColors.Control;
            this.butEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butEdit.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butEdit.Image = ((System.Drawing.Image)(resources.GetObject("butEdit.Image")));
            this.butEdit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butEdit.Location = new System.Drawing.Point(100, 6);
            this.butEdit.Name = "butEdit";
            this.butEdit.Size = new System.Drawing.Size(60, 28);
            this.butEdit.TabIndex = 106;
            this.butEdit.Text = "Sửa";
            this.butEdit.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.butEdit, "Alt+S");
            this.butEdit.UseVisualStyleBackColor = true;
            this.butEdit.Click += new System.EventHandler(this.butEdit_Click);
            // 
            // butThem
            // 
            this.butThem.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butThem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butThem.Image = ((System.Drawing.Image)(resources.GetObject("butThem.Image")));
            this.butThem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butThem.Location = new System.Drawing.Point(30, 6);
            this.butThem.Name = "butThem";
            this.butThem.Size = new System.Drawing.Size(60, 28);
            this.butThem.TabIndex = 0;
            this.butThem.Text = "&Lưu";
            this.butThem.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.butThem, "Alt+T");
            this.butThem.UseVisualStyleBackColor = true;
            this.butThem.Click += new System.EventHandler(this.butThem_Click);
            // 
            // butHuy
            // 
            this.butHuy.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butHuy.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butHuy.Image = ((System.Drawing.Image)(resources.GetObject("butHuy.Image")));
            this.butHuy.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butHuy.Location = new System.Drawing.Point(170, 6);
            this.butHuy.Name = "butHuy";
            this.butHuy.Size = new System.Drawing.Size(60, 28);
            this.butHuy.TabIndex = 4;
            this.butHuy.Text = " &Hủy";
            this.butHuy.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.butHuy, "Alt+H");
            this.butHuy.UseVisualStyleBackColor = true;
            this.butHuy.Click += new System.EventHandler(this.butHuy_Click);
            // 
            // butKetThuc
            // 
            this.butKetThuc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butKetThuc.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butKetThuc.Image = global::Human.Properties.Resources.close_r;
            this.butKetThuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butKetThuc.Location = new System.Drawing.Point(240, 6);
            this.butKetThuc.Name = "butKetThuc";
            this.butKetThuc.Size = new System.Drawing.Size(75, 28);
            this.butKetThuc.TabIndex = 7;
            this.butKetThuc.Text = "&Kết thúc";
            this.butKetThuc.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.butKetThuc, "Alt+K");
            this.butKetThuc.UseVisualStyleBackColor = true;
            this.butKetThuc.Click += new System.EventHandler(this.butKetThuc_Click);
            // 
            // dtpNgayCongTac
            // 
            this.dtpNgayCongTac.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtpNgayCongTac.Location = new System.Drawing.Point(541, 441);
            this.dtpNgayCongTac.Mask = "##/##/####";
            this.dtpNgayCongTac.Name = "dtpNgayCongTac";
            this.dtpNgayCongTac.Size = new System.Drawing.Size(80, 23);
            this.dtpNgayCongTac.TabIndex = 32;
            this.dtpNgayCongTac.Text = "__/__/____";
            this.dtpNgayCongTac.Visible = false;
            // 
            // dtpNgayCapCMND
            // 
            this.dtpNgayCapCMND.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtpNgayCapCMND.Location = new System.Drawing.Point(629, 441);
            this.dtpNgayCapCMND.Mask = "##/##/####";
            this.dtpNgayCapCMND.Name = "dtpNgayCapCMND";
            this.dtpNgayCapCMND.Size = new System.Drawing.Size(80, 23);
            this.dtpNgayCapCMND.TabIndex = 33;
            this.dtpNgayCapCMND.Text = "__/__/____";
            this.dtpNgayCapCMND.Visible = false;
            // 
            // dtpNgaySinh
            // 
            this.dtpNgaySinh.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtpNgaySinh.Location = new System.Drawing.Point(437, 441);
            this.dtpNgaySinh.Mask = "##/##/####";
            this.dtpNgaySinh.Name = "dtpNgaySinh";
            this.dtpNgaySinh.Size = new System.Drawing.Size(96, 23);
            this.dtpNgaySinh.TabIndex = 31;
            this.dtpNgaySinh.Text = "__/__/____";
            this.dtpNgaySinh.Visible = false;
            // 
            // lblTenPhongCT
            // 
            this.lblTenPhongCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblTenPhongCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblTenPhongCT.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.lblTenPhongCT.Location = new System.Drawing.Point(650, 6);
            this.lblTenPhongCT.Name = "lblTenPhongCT";
            this.lblTenPhongCT.Size = new System.Drawing.Size(138, 40);
            this.lblTenPhongCT.TabIndex = 259;
            this.lblTenPhongCT.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblHoTenNVCT
            // 
            this.lblHoTenNVCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblHoTenNVCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblHoTenNVCT.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.lblHoTenNVCT.Location = new System.Drawing.Point(364, 6);
            this.lblHoTenNVCT.Name = "lblHoTenNVCT";
            this.lblHoTenNVCT.Size = new System.Drawing.Size(280, 40);
            this.lblHoTenNVCT.TabIndex = 258;
            this.lblHoTenNVCT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label29
            // 
            this.label29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label29.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label29.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label29.Location = new System.Drawing.Point(308, 6);
            this.label29.Name = "label29";
            this.label29.Size = new System.Drawing.Size(56, 40);
            this.label29.TabIndex = 257;
            this.label29.Text = "Họ tên ";
            this.label29.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // label28
            // 
            this.label28.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label28.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label28.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label28.Location = new System.Drawing.Point(150, 6);
            this.label28.Name = "label28";
            this.label28.Size = new System.Drawing.Size(56, 40);
            this.label28.TabIndex = 262;
            this.label28.Text = "Mã số";
            this.label28.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblMasoNVCT
            // 
            this.lblMasoNVCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblMasoNVCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblMasoNVCT.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.lblMasoNVCT.Location = new System.Drawing.Point(208, 7);
            this.lblMasoNVCT.Name = "lblMasoNVCT";
            this.lblMasoNVCT.Size = new System.Drawing.Size(95, 40);
            this.lblMasoNVCT.TabIndex = 261;
            this.lblMasoNVCT.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // toolStrip3
            // 
            this.toolStrip3.AutoSize = false;
            this.toolStrip3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.lblHD});
            this.toolStrip3.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
            this.toolStrip3.Location = new System.Drawing.Point(0, 0);
            this.toolStrip3.Name = "toolStrip3";
            this.toolStrip3.Size = new System.Drawing.Size(790, 51);
            this.toolStrip3.TabIndex = 260;
            this.toolStrip3.Text = "toolStrip3";
            // 
            // lblHD
            // 
            this.lblHD.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblHD.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Bold);
            this.lblHD.ForeColor = System.Drawing.Color.White;
            this.lblHD.Name = "lblHD";
            this.lblHD.Size = new System.Drawing.Size(114, 48);
            this.lblHD.Text = "ĐOÀN THỂ";
            // 
            // txtNTGCM_DT
            // 
            this.txtNTGCM_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNTGCM_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNTGCM_DT.Location = new System.Drawing.Point(483, 41);
            this.txtNTGCM_DT.Mask = "00/00/0000";
            this.txtNTGCM_DT.Name = "txtNTGCM_DT";
            this.txtNTGCM_DT.Size = new System.Drawing.Size(85, 23);
            this.txtNTGCM_DT.TabIndex = 3;
            this.txtNTGCM_DT.ValidatingType = typeof(System.DateTime);
            this.txtNTGCM_DT.Validated += new System.EventHandler(this.txtNTGCM_DT_Validated);
            this.txtNTGCM_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNTGCM_DT_KeyDown);
            // 
            // txtNTL_DT
            // 
            this.txtNTL_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNTL_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNTL_DT.Location = new System.Drawing.Point(685, 42);
            this.txtNTL_DT.Mask = "00/00/0000";
            this.txtNTL_DT.Name = "txtNTL_DT";
            this.txtNTL_DT.Size = new System.Drawing.Size(80, 23);
            this.txtNTL_DT.TabIndex = 4;
            this.txtNTL_DT.ValidatingType = typeof(System.DateTime);
            this.txtNTL_DT.Validated += new System.EventHandler(this.txtNTL_DT_Validated);
            this.txtNTL_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNTL_DT_KeyDown);
            // 
            // txtNDB_DT
            // 
            this.txtNDB_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNDB_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNDB_DT.Location = new System.Drawing.Point(117, 118);
            this.txtNDB_DT.Mask = "00/00/0000";
            this.txtNDB_DT.Name = "txtNDB_DT";
            this.txtNDB_DT.Size = new System.Drawing.Size(85, 23);
            this.txtNDB_DT.TabIndex = 8;
            this.txtNDB_DT.ValidatingType = typeof(System.DateTime);
            this.txtNDB_DT.Validated += new System.EventHandler(this.txtNDB_DT_Validated);
            this.txtNDB_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNDB_DT_KeyDown);
            // 
            // txtNCT_DT
            // 
            this.txtNCT_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNCT_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNCT_DT.Location = new System.Drawing.Point(391, 119);
            this.txtNCT_DT.Mask = "00/00/0000";
            this.txtNCT_DT.Name = "txtNCT_DT";
            this.txtNCT_DT.Size = new System.Drawing.Size(80, 23);
            this.txtNCT_DT.TabIndex = 9;
            this.txtNCT_DT.ValidatingType = typeof(System.DateTime);
            this.txtNCT_DT.Validated += new System.EventHandler(this.txtNCT_DT_Validated);
            this.txtNCT_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCT_DT_KeyDown);
            // 
            // txtNTN_DT
            // 
            this.txtNTN_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNTN_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNTN_DT.Location = new System.Drawing.Point(391, 158);
            this.txtNTN_DT.Mask = "00/00/0000";
            this.txtNTN_DT.Name = "txtNTN_DT";
            this.txtNTN_DT.Size = new System.Drawing.Size(81, 23);
            this.txtNTN_DT.TabIndex = 11;
            this.txtNTN_DT.ValidatingType = typeof(System.DateTime);
            this.txtNTN_DT.Validated += new System.EventHandler(this.txtNTN_DT_Validated);
            this.txtNTN_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNTN_DT_KeyDown);
            // 
            // txtNCD_DT
            // 
            this.txtNCD_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNCD_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNCD_DT.Location = new System.Drawing.Point(391, 189);
            this.txtNCD_DT.Mask = "00/00/0000";
            this.txtNCD_DT.Name = "txtNCD_DT";
            this.txtNCD_DT.Size = new System.Drawing.Size(81, 23);
            this.txtNCD_DT.TabIndex = 14;
            this.txtNCD_DT.ValidatingType = typeof(System.DateTime);
            this.txtNCD_DT.Validated += new System.EventHandler(this.txtNCD_DT_Validated);
            this.txtNCD_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCD_DT_KeyDown);
            // 
            // txtCDP_DT
            // 
            this.txtCDP_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtCDP_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtCDP_DT.Location = new System.Drawing.Point(685, 218);
            this.txtCDP_DT.Mask = "00/00/0000";
            this.txtCDP_DT.Name = "txtCDP_DT";
            this.txtCDP_DT.Size = new System.Drawing.Size(80, 23);
            this.txtCDP_DT.TabIndex = 20;
            this.txtCDP_DT.ValidatingType = typeof(System.DateTime);
            this.txtCDP_DT.Validated += new System.EventHandler(this.txtCDP_DT_Validated);
            this.txtCDP_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCDP_DT_KeyDown);
            // 
            // txtNKN_DT
            // 
            this.txtNKN_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNKN_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNKN_DT.Location = new System.Drawing.Point(495, 218);
            this.txtNKN_DT.Mask = "00/00/0000";
            this.txtNKN_DT.Name = "txtNKN_DT";
            this.txtNKN_DT.Size = new System.Drawing.Size(85, 23);
            this.txtNKN_DT.TabIndex = 19;
            this.txtNKN_DT.ValidatingType = typeof(System.DateTime);
            this.txtNKN_DT.Validated += new System.EventHandler(this.txtNKN_DT_Validated);
            this.txtNKN_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNKN_DT_KeyDown);
            // 
            // txtNVD_DT
            // 
            this.txtNVD_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNVD_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNVD_DT.Location = new System.Drawing.Point(495, 244);
            this.txtNVD_DT.Mask = "00/00/0000";
            this.txtNVD_DT.Name = "txtNVD_DT";
            this.txtNVD_DT.Size = new System.Drawing.Size(85, 23);
            this.txtNVD_DT.TabIndex = 24;
            this.txtNVD_DT.ValidatingType = typeof(System.DateTime);
            this.txtNVD_DT.Validated += new System.EventHandler(this.txtNVD_DT_Validated);
            this.txtNVD_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNVD_DT_KeyDown);
            // 
            // txtDP_DT
            // 
            this.txtDP_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtDP_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtDP_DT.Location = new System.Drawing.Point(685, 269);
            this.txtDP_DT.Mask = "00/00/0000";
            this.txtDP_DT.Name = "txtDP_DT";
            this.txtDP_DT.Size = new System.Drawing.Size(80, 23);
            this.txtDP_DT.TabIndex = 26;
            this.txtDP_DT.ValidatingType = typeof(System.DateTime);
            this.txtDP_DT.Validated += new System.EventHandler(this.txtDP_DT_Validated);
            this.txtDP_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDP_DT_KeyDown);
            // 
            // txtNCDen_DT
            // 
            this.txtNCDen_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNCDen_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNCDen_DT.Location = new System.Drawing.Point(685, 243);
            this.txtNCDen_DT.Mask = "00/00/0000";
            this.txtNCDen_DT.Name = "txtNCDen_DT";
            this.txtNCDen_DT.Size = new System.Drawing.Size(80, 23);
            this.txtNCDen_DT.TabIndex = 25;
            this.txtNCDen_DT.ValidatingType = typeof(System.DateTime);
            this.txtNCDen_DT.Validated += new System.EventHandler(this.txtNCDen_DT_Validated);
            this.txtNCDen_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCDen_DT_KeyDown);
            // 
            // group
            // 
            this.group.Controls.Add(this.cbo_cqcvht);
            this.group.Controls.Add(this.cbo_doanthecvht);
            this.group.Controls.Add(this.cbo_cqcvvq);
            this.group.Controls.Add(this.cbo_dagcvht);
            this.group.Controls.Add(this.cbo_doanthecvvq);
            this.group.Controls.Add(this.cbo_dagcvvq);
            this.group.Controls.Add(this.cbo_todoan);
            this.group.Controls.Add(this.cbo_tocdoan);
            this.group.Controls.Add(this.cbo_chibodt);
            this.group.Controls.Add(this.cboTPBT_DT);
            this.group.Controls.Add(this.txtDP_DT);
            this.group.Controls.Add(this.label123);
            this.group.Controls.Add(this.txtNCDen_DT);
            this.group.Controls.Add(this.label130);
            this.group.Controls.Add(this.txtNVD_DT);
            this.group.Controls.Add(this.label136);
            this.group.Controls.Add(this.txtCDP_DT);
            this.group.Controls.Add(this.label124);
            this.group.Controls.Add(this.txtNKN_DT);
            this.group.Controls.Add(this.label142);
            this.group.Controls.Add(this.txtNTN_DT);
            this.group.Controls.Add(this.cboTPXT_DT);
            this.group.Controls.Add(this.txtNCDi_DT);
            this.group.Controls.Add(this.txtNCD_DT);
            this.group.Controls.Add(this.cboNG_DT);
            this.group.Controls.Add(this.txtNCT_DT);
            this.group.Controls.Add(this.txtNTGCM_DT);
            this.group.Controls.Add(this.txtNDB_DT);
            this.group.Controls.Add(this.label152);
            this.group.Controls.Add(this.txtNTL_DT);
            this.group.Controls.Add(this.label153);
            this.group.Controls.Add(this.cboDTCT_DT);
            this.group.Controls.Add(this.label154);
            this.group.Controls.Add(this.label128);
            this.group.Controls.Add(this.label151);
            this.group.Controls.Add(this.label133);
            this.group.Controls.Add(this.label150);
            this.group.Controls.Add(this.label3);
            this.group.Controls.Add(this.label1);
            this.group.Controls.Add(this.label127);
            this.group.Controls.Add(this.label149);
            this.group.Controls.Add(this.label135);
            this.group.Controls.Add(this.label147);
            this.group.Controls.Add(this.label131);
            this.group.Controls.Add(this.label148);
            this.group.Controls.Add(this.label132);
            this.group.Controls.Add(this.label143);
            this.group.Controls.Add(this.label2);
            this.group.Controls.Add(this.label141);
            this.group.Controls.Add(this.txtnoiCDi_DT);
            this.group.Controls.Add(this.txtDang_DT);
            this.group.Controls.Add(this.txtNoiCD_DT);
            this.group.Controls.Add(this.txtSTD_DT);
            this.group.Controls.Add(this.label145);
            this.group.Controls.Add(this.label126);
            this.group.Controls.Add(this.label125);
            this.group.Controls.Add(this.label137);
            this.group.Controls.Add(this.label129);
            this.group.Controls.Add(this.label134);
            this.group.Controls.Add(this.txtST2_DT);
            this.group.Controls.Add(this.label138);
            this.group.Controls.Add(this.label139);
            this.group.Controls.Add(this.txtDoan_DT);
            this.group.Controls.Add(this.label140);
            this.group.Controls.Add(this.txtST1_DT);
            this.group.Controls.Add(this.label144);
            this.group.Controls.Add(this.label146);
            this.group.Controls.Add(this.txtCD_DT);
            this.group.Location = new System.Drawing.Point(6, 55);
            this.group.Name = "group";
            this.group.Size = new System.Drawing.Size(776, 383);
            this.group.TabIndex = 263;
            this.group.TabStop = false;
            // 
            // cbo_cqcvht
            // 
            this.cbo_cqcvht.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_cqcvht.FormattingEnabled = true;
            this.cbo_cqcvht.Location = new System.Drawing.Point(604, 334);
            this.cbo_cqcvht.Name = "cbo_cqcvht";
            this.cbo_cqcvht.Size = new System.Drawing.Size(136, 24);
            this.cbo_cqcvht.TabIndex = 32;
            this.cbo_cqcvht.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_cqcvht_KeyDown);
            // 
            // cbo_doanthecvht
            // 
            this.cbo_doanthecvht.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_doanthecvht.FormattingEnabled = true;
            this.cbo_doanthecvht.Location = new System.Drawing.Point(391, 335);
            this.cbo_doanthecvht.Name = "cbo_doanthecvht";
            this.cbo_doanthecvht.Size = new System.Drawing.Size(136, 24);
            this.cbo_doanthecvht.TabIndex = 31;
            this.cbo_doanthecvht.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_doanthecvht_KeyDown);
            // 
            // cbo_cqcvvq
            // 
            this.cbo_cqcvvq.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_cqcvvq.FormattingEnabled = true;
            this.cbo_cqcvvq.Location = new System.Drawing.Point(604, 305);
            this.cbo_cqcvvq.Name = "cbo_cqcvvq";
            this.cbo_cqcvvq.Size = new System.Drawing.Size(136, 24);
            this.cbo_cqcvvq.TabIndex = 29;
            this.cbo_cqcvvq.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_cqcvvq_KeyDown);
            // 
            // cbo_dagcvht
            // 
            this.cbo_dagcvht.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_dagcvht.FormattingEnabled = true;
            this.cbo_dagcvht.Location = new System.Drawing.Point(181, 335);
            this.cbo_dagcvht.Name = "cbo_dagcvht";
            this.cbo_dagcvht.Size = new System.Drawing.Size(136, 24);
            this.cbo_dagcvht.TabIndex = 30;
            this.cbo_dagcvht.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_dagcvht_KeyDown);
            // 
            // cbo_doanthecvvq
            // 
            this.cbo_doanthecvvq.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_doanthecvvq.FormattingEnabled = true;
            this.cbo_doanthecvvq.Location = new System.Drawing.Point(391, 305);
            this.cbo_doanthecvvq.Name = "cbo_doanthecvvq";
            this.cbo_doanthecvvq.Size = new System.Drawing.Size(136, 24);
            this.cbo_doanthecvvq.TabIndex = 28;
            this.cbo_doanthecvvq.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_doanthecvvq_KeyDown);
            // 
            // cbo_dagcvvq
            // 
            this.cbo_dagcvvq.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_dagcvvq.FormattingEnabled = true;
            this.cbo_dagcvvq.Location = new System.Drawing.Point(181, 305);
            this.cbo_dagcvvq.Name = "cbo_dagcvvq";
            this.cbo_dagcvvq.Size = new System.Drawing.Size(136, 24);
            this.cbo_dagcvvq.TabIndex = 27;
            this.cbo_dagcvvq.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_dagcvvq_KeyDown);
            // 
            // cbo_todoan
            // 
            this.cbo_todoan.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_todoan.FormattingEnabled = true;
            this.cbo_todoan.Location = new System.Drawing.Point(142, 247);
            this.cbo_todoan.Name = "cbo_todoan";
            this.cbo_todoan.Size = new System.Drawing.Size(136, 24);
            this.cbo_todoan.TabIndex = 22;
            this.cbo_todoan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_todoan_KeyDown);
            // 
            // cbo_tocdoan
            // 
            this.cbo_tocdoan.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_tocdoan.FormattingEnabled = true;
            this.cbo_tocdoan.Location = new System.Drawing.Point(142, 217);
            this.cbo_tocdoan.Name = "cbo_tocdoan";
            this.cbo_tocdoan.Size = new System.Drawing.Size(136, 24);
            this.cbo_tocdoan.TabIndex = 17;
            this.cbo_tocdoan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_tocdoan_KeyDown);
            // 
            // cbo_chibodt
            // 
            this.cbo_chibodt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbo_chibodt.FormattingEnabled = true;
            this.cbo_chibodt.Location = new System.Drawing.Point(207, 79);
            this.cbo_chibodt.Name = "cbo_chibodt";
            this.cbo_chibodt.Size = new System.Drawing.Size(136, 24);
            this.cbo_chibodt.TabIndex = 6;
            this.cbo_chibodt.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbo_chibodt_KeyDown);
            // 
            // txtNCDi_DT
            // 
            this.txtNCDi_DT.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNCDi_DT.ForeColor = System.Drawing.Color.Navy;
            this.txtNCDi_DT.Location = new System.Drawing.Point(558, 159);
            this.txtNCDi_DT.Mask = "00/00/0000";
            this.txtNCDi_DT.Name = "txtNCDi_DT";
            this.txtNCDi_DT.Size = new System.Drawing.Size(85, 23);
            this.txtNCDi_DT.TabIndex = 12;
            this.txtNCDi_DT.ValidatingType = typeof(System.DateTime);
            this.txtNCDi_DT.Validated += new System.EventHandler(this.txtNCDi_DT_Validated);
            this.txtNCDi_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCDi_DT_KeyDown);
            // 
            // label3
            // 
            this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.ForeColor = System.Drawing.Color.DarkBlue;
            this.label3.Location = new System.Drawing.Point(36, 195);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(73, 13);
            this.label3.TabIndex = 197;
            this.label3.Text = "Nơi chuyển đi";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.DarkBlue;
            this.label1.Location = new System.Drawing.Point(473, 196);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(83, 13);
            this.label1.TabIndex = 197;
            this.label1.Text = "Nơi chuyển đến";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.Color.DarkBlue;
            this.label2.Location = new System.Drawing.Point(473, 165);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(82, 13);
            this.label2.TabIndex = 210;
            this.label2.Text = "Ngày chuyển đi";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txtnoiCDi_DT
            // 
            this.txtnoiCDi_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtnoiCDi_DT.Location = new System.Drawing.Point(117, 189);
            this.txtnoiCDi_DT.MaxLength = 1000;
            this.txtnoiCDi_DT.Name = "txtnoiCDi_DT";
            this.txtnoiCDi_DT.Size = new System.Drawing.Size(167, 22);
            this.txtnoiCDi_DT.TabIndex = 13;
            this.txtnoiCDi_DT.WordWrap = false;
            this.txtnoiCDi_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtnoiCDi_DT_KeyDown);
            // 
            // txtNoiCD_DT
            // 
            this.txtNoiCD_DT.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNoiCD_DT.Location = new System.Drawing.Point(558, 190);
            this.txtNoiCD_DT.MaxLength = 1000;
            this.txtNoiCD_DT.Name = "txtNoiCD_DT";
            this.txtNoiCD_DT.Size = new System.Drawing.Size(207, 22);
            this.txtNoiCD_DT.TabIndex = 15;
            this.txtNoiCD_DT.WordWrap = false;
            this.txtNoiCD_DT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNoiCD_DT_KeyDown);
            // 
            // frmDoanThe
            // 
            this.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoScroll = true;
            this.ClientSize = new System.Drawing.Size(790, 527);
            this.Controls.Add(this.group);
            this.Controls.Add(this.lblTenPhongCT);
            this.Controls.Add(this.lblHoTenNVCT);
            this.Controls.Add(this.label29);
            this.Controls.Add(this.label28);
            this.Controls.Add(this.lblMasoNVCT);
            this.Controls.Add(this.toolStrip3);
            this.Controls.Add(this.dtpNgaySinh);
            this.Controls.Add(this.dtpNgayCongTac);
            this.Controls.Add(this.dtpNgayCapCMND);
            this.Controls.Add(this.txtTSo);
            this.Controls.Add(this.label27);
            this.Controls.Add(this.panButLyLich);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "frmDoanThe";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Đoàn thể";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.frmDoanThe_KeyDown);
            this.Load += new System.EventHandler(this.frmDoanTheSua_Load);
            this.panButLyLich.ResumeLayout(false);
            this.toolStrip3.ResumeLayout(false);
            this.toolStrip3.PerformLayout();
            this.group.ResumeLayout(false);
            this.group.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

		private void themnhanvien()
		{	
			try
			{
            	capnhatDoanthe();
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
			}
		}
		private void Load_DT()
		{
			ThanhphanXT();
            ThanhphanBT();
            dmchibo("D",cbo_chibodt);
            dmchibo("C",cbo_tocdoan);
            dmchibo("T",cbo_todoan);
            dmchucvudang("D",cbo_dagcvvq);
            dmchucvudang("T",cbo_doanthecvvq);
            dmchucvudang("D",cbo_dagcvht);
            dmchucvudang("T",cbo_doanthecvht);
            dmcv(cbo_cqcvvq);
            dmcv(cbo_cqcvht);
			Nguongoc(); 
			DTChinhTri();
		}
		private void goicb()
		{		
			cboTPXT_DT.SelectedIndex=-1;
            cboTPBT_DT.SelectedIndex=-1;
			cboNG_DT.SelectedIndex=-1;
            txtNTGCM_DT.Text="";
            txtNTL_DT.Text="";
			txtDang_DT.Text="";
            txtSTD_DT.Text="";
            txtNDB_DT.Text="";
            txtNCT_DT.Text="";
			//txtCB_DT.Text="";
            txtNCD_DT.Text="";
            cboDTCT_DT.SelectedIndex=-1;
            txtNTN_DT.Text="";
			txtCD_DT.Text="";
            //txtTo1_DT.Text="";
            txtST1_DT.Text="";
            txtNKN_DT.Text="";
            txtCDP_DT.Text="";
			txtDoan_DT.Text="";
           // txtTo2_DT.Text="";
            txtST2_DT.Text="";
            txtNVD_DT.Text="";
			txtNCDen_DT.Text="";
            txtDP_DT.Text="";
			//txtDcvvq_DT.Text="";
            //txtDTcvvq_DT.Text="";
            //txtCQcvvq_DT.Text="";
			//txtDcvht_DT.Text="";
            //txtDTcvht.Text="";
           // txtCQcvht_DT.Text="";
            txtNCDi_DT.Text = "";
            txtnoiCDi_DT.Text = "";
            txtNoiCD_DT.Text = "";
            //moi them
            //cbo_chibodt.Text = "";
            //cbo_tocdoan.Text = "";
            //cbo_todoan.Text = "";
            //cbo_dagcvvq.Text = "";
            //cbo_doanthecvvq.Text = "";
            //cbo_cqcvvq.Text = "";
            //cbo_dagcvht.Text = "";
            //cbo_doanthecvht.Text = "";
            //cbo_cqcvht.Text = "";
            cbo_chibodt.SelectedIndex = -1;
            cbo_tocdoan.SelectedIndex = -1;
            cbo_todoan.SelectedIndex = -1;
            cbo_dagcvvq.SelectedIndex = -1;
            cbo_doanthecvvq.SelectedIndex = -1;
            cbo_cqcvvq.SelectedIndex = -1;
            cbo_dagcvht.SelectedIndex = -1;
            cbo_doanthecvht.SelectedIndex = -1;
            cbo_cqcvht.SelectedIndex = -1;

		}		
		private void load_doanthe(string v_manv,string v_ho,string v_bophan)
		{
			try
			{
				v_manv=get_llnvmanv;
				v_ho=get_llnvmanv1;
				v_bophan=get_llnvmanv2;
				if (lblMasoNVCT.Text.Trim()=="".ToString())
				{
					lblMasoNVCT.Text="00000";					
				}
				else
				{
					lblMasoNVCT.Text=v_manv;
					lblHoTenNVCT.Text=v_ho;
					lblTenPhongCT.Text=v_bophan;
					load_doanthe();
				}
			}
			catch{}		
		}
		private void load_doanthe()
		{
			try
			{
				string ma_nv=lblMasoNVCT.Text;
				DataSet ds=new DataSet();
                sql = "SELECT mnvmay,manv,tp_x_than,tp_b_than,nguongoc," +
                " to_char(ngay_t_gia,'dd/mm/yyyy')as m_ngay_t_gia," +
                " to_char(ngay_t_ly,'dd/mm/yyyy') as m_ngay_t_ly," +
                " to_char(dubi_dang,'dd/mm/yyyy') as m_dubi_dang," +
                " to_char(cthuc_dang,'dd/mm/yyyy') as m_cthuc_dang," +
                " chinhtri,to_char(ngay_tn,'dd/mm/yyyy') as m_ngay_tn," +
                " to_char(ngay_doan,'dd/mm/yyyy') as m_ngay_doan" +
                " ,to_char(ngaychuyendi_dang,'dd/mm/yyyy') as m_ngaycdi_dang,noichuyendi_dang,noichuyenden_dang "+
                " FROM "+mDB.user+".llnv WHERE manv='" + ma_nv.Trim() + "'";
				ds=mDB.get_data(sql);
				DataRow []r=ds.Tables[0].Select("mnvmay='"+ma_nv+"'");
				cboTPXT_DT.SelectedValue=r[0]["tp_x_than"].ToString();
				cboTPBT_DT.SelectedValue=r[0]["tp_b_than"].ToString();
				cboNG_DT.SelectedValue=r[0]["nguongoc"].ToString();
				txtNTGCM_DT.Text=r[0]["m_ngay_t_gia"].ToString();
				txtNTL_DT.Text=r[0]["m_ngay_t_ly"].ToString();
				txtNDB_DT.Text=r[0]["m_dubi_dang"].ToString();
				txtNCT_DT.Text=r[0]["m_cthuc_dang"].ToString();
				cboDTCT_DT.SelectedValue=r[0]["chinhtri"].ToString();
				txtNTN_DT.Text=r[0]["m_ngay_tn"].ToString();
				txtNVD_DT.Text=r[0]["m_ngay_doan"].ToString();
                // cap nhat ngay 1509
                txtNCDi_DT.Text = r[0]["m_ngaycdi_dang"].ToString();
                txtnoiCDi_DT.Text = r[0]["noichuyendi_dang"].ToString();
                txtNoiCD_DT.Text = r[0]["noichuyenden_dang"].ToString();

				DataSet ds1=new DataSet();
				ds1=f_Dthopdong(ma_nv);
				DataRow []r1=ds1.Tables[0].Select("manv='"+ma_nv+"'");
				txtDang_DT.Text=r1[0]["dang"].ToString();
				txtSTD_DT.Text=r1[0]["thedang"].ToString();
				txtNCD_DT.Text=r1[0]["m_chuyen_den"].ToString();
				cbo_chibodt.Text=r1[0]["chi_bo"].ToString();				
				txtCD_DT.Text=r1[0]["cong_doan"].ToString();
				cbo_tocdoan.Text=r1[0]["TO_t"].ToString();
				txtST1_DT.Text=r1[0]["THE_CDOAN"].ToString();
				txtCDP_DT.Text=r1[0]["m_cdoanphi"].ToString();
				txtNKN_DT.Text=r1[0]["m_vao_cdoan"].ToString();				
				txtDoan_DT.Text=r1[0]["doan"].ToString();
				txtNCDen_DT.Text=r1[0]["m_doan_den"].ToString();
				cbo_todoan.Text=r1[0]["todoan"].ToString();
				txtST2_DT.Text=r1[0]["thedoan"].ToString();				
				txtDP_DT.Text=r1[0]["m_doanphi"].ToString();
				cbo_dagcvvq.Text=r1[0]["max_dang"].ToString();
				cbo_doanthecvvq.Text=r1[0]["max_doan"].ToString();
				cbo_cqcvvq.Text=r1[0]["max_cquyen"].ToString();
				cbo_dagcvht.Text=r1[0]["cmax_dang"].ToString();
				cbo_doanthecvht.Text=r1[0]["cmax_doan"].ToString();
				cbo_cqcvht.Text=r1[0]["cmax_quyen"].ToString();
			}
			catch{}
		}
		 string getDang()
		{
			return dang_h;
		}
		 string getChibo()
		{
			return cb_h;
		}
		public string getDoan()
		{
			return doan_h;
		}
		public string getCongdoan()
		{
			return cd_h;
		}
		private void capnhatDoanthe()
		{
			try
			{
				string ma_nv=lblMasoNVCT.Text;
				string dtct_l="",ng_l="",ntgcm_l="",ntl_l="",nvd_l="",ndb_l="",nct_l="",tpxt_l="",tpbt_l="",ntn_l="";
                string ncdi_dt = "", noicdi_dt = "", noicden_dt = "";				
				tpxt_l=(cboTPXT_DT.SelectedIndex==-1)?"":cboTPXT_DT.SelectedValue.ToString();
				tpbt_l=(cboTPBT_DT.SelectedIndex==-1)?"":cboTPBT_DT.SelectedValue.ToString();
				ng_l=(cboNG_DT.SelectedIndex==-1)?"":cboNG_DT.SelectedValue.ToString();
                if (txtNTGCM_DT.Text != "  /  /")
                    ntgcm_l = txtNTGCM_DT.Text;
                else
                    ntgcm_l = "";
                if (txtNTL_DT.Text != "  /  /")
                    ntl_l = txtNTL_DT.Text;
                else
                    ntl_l = "";
                if (txtNDB_DT.Text != "  /  /")
                    ndb_l = txtNDB_DT.Text;
                else
                    ndb_l = "";

                if (txtNCT_DT.Text != "  /  /")
                    nct_l = txtNCT_DT.Text;
                else
                    nct_l = "";

                //cap nhat 1509
                if (txtNCDi_DT.Text != "  /  /")
                    ncdi_dt = txtNCDi_DT.Text;
                else
                    ncdi_dt = "";
                noicden_dt = txtNoiCD_DT.Text.Trim();
                noicdi_dt = txtnoiCDi_DT.Text.Trim();

				dtct_l=(cboDTCT_DT.SelectedIndex==-1)?"":cboDTCT_DT.SelectedValue.ToString();
                if (txtNTN_DT.Text != "  /  /")
                    ntn_l = txtNTN_DT.Text;
                else
                    ntn_l = "";
                if (txtNVD_DT.Text != "  /  /")
                    nvd_l = txtNVD_DT.Text;
                else
                    nvd_l = "";
				mDB.upd_lylichnvDoanThe(ma_nv,dtct_l,ng_l,ntgcm_l,ntl_l,nvd_l,ndb_l,nct_l,tpxt_l,tpbt_l,ntn_l,ncdi_dt,noicdi_dt,noicden_dt);

				string std_h,ncd_h,t1_h,st1_h,
					cdp_h,nkn_h,ncden_h,t2_h,st2_h,dp_h,
					d1_h,dt1_h,cq1_h,d2_h,dt2_h,cq2_h;
				dang_h=txtDang_DT.Text;
				std_h=txtSTD_DT.Text;
                if (txtNCD_DT.Text != "  /  /")
                    ncd_h = txtNCD_DT.Text;
                else
                    ncd_h = "";
                cb_h = (cbo_chibodt.SelectedIndex == -1) ? "" : cbo_chibodt.SelectedValue.ToString();
				//cb_h=cbo_chibodt.Text;//txtCB_DT.Text;
				cd_h=txtCD_DT.Text;
                t1_h = (cbo_tocdoan.SelectedIndex == -1) ? "" : cbo_tocdoan.SelectedValue.ToString();
				//t1_h=cbo_tocdoan.Text;//txtTo1_DT.Text;
				st1_h=txtST1_DT.Text;
                if (txtCDP_DT.Text != "  /  /")
                    cdp_h = txtCDP_DT.Text;
                else
                    cdp_h = "";
                if (txtNKN_DT.Text != "  /  /")
                    nkn_h = txtNKN_DT.Text;
                else
                    nkn_h = "";
				doan_h=txtDoan_DT.Text;
                if (txtNCDen_DT.Text != "  /  /")
                    ncden_h = txtNCDen_DT.Text;
                else
                    ncden_h = "";
                t2_h = (cbo_todoan.SelectedIndex == -1) ? "" : cbo_todoan.SelectedValue.ToString();
				//t2_h=cbo_todoan.Text;//txtTo2_DT.Text;
				st2_h=txtST2_DT.Text;
                if (txtDP_DT.Text != "  /  /")
                    dp_h = txtDP_DT.Text;
                else
                    dp_h = "";
                d1_h = (cbo_dagcvvq.SelectedIndex == -1) ? "" : cbo_dagcvvq.SelectedValue.ToString();
                dt1_h = (cbo_doanthecvvq.SelectedIndex == -1) ? "" : cbo_doanthecvvq.SelectedValue.ToString();
                cq1_h = (cbo_cqcvvq.SelectedIndex == -1) ? "" : cbo_cqcvvq.SelectedValue.ToString();
                d2_h = (cbo_dagcvht.SelectedIndex == -1) ? "" : cbo_dagcvht.SelectedValue.ToString();
                dt2_h = (cbo_doanthecvht.SelectedIndex == -1) ? "" : cbo_doanthecvht.SelectedValue.ToString();
                cq2_h = (cbo_cqcvht.SelectedIndex == -1) ? "" : cbo_cqcvht.SelectedValue.ToString();
	
				mDB.upd_hopdongDoanThe(ma_nv,dang_h,std_h,ncd_h,
					cb_h,cd_h,t1_h,st1_h,cdp_h,
					nkn_h,doan_h,ncden_h,t2_h,st2_h,
					dp_h,d1_h,dt1_h,cq1_h,d2_h,
					dt2_h,cq2_h);
			}
			catch{}
		}

		private void butThem_Click(object sender, System.EventArgs e)
		{
			try
			{	
				chon=true;
				themnhanvien();											
				tongso();
                setcontrol(false);
                butEdit.Enabled = admin;
                butHuy.Enabled = admin;
				butKetThuc.Focus();
			}
			catch{}
		}
		public void tongso()
		{
			try
			{
				ds=mDB.f_countNV();
				TSo=ds.Tables[0].Rows[0][0].ToString();
				txtTSo.Text="";
				txtTSo.Text=TSo.ToString();
			}
			catch{}
		}
		public string get_llnvmanv
		{
			get
			{
				v_manv=lblMasoNVCT.Text.ToString();				
				return v_manv;
			}
		}
		public string get_llnvmanv1
		{
			get
			{	
				v_ho=lblHoTenNVCT.Text.ToString();
				return v_ho;
			}
		}
		public string get_llnvmanv2
		{
			get
			{				
				v_bophan=lblTenPhongCT.Text.ToString();
				return v_bophan;
			}
		}
		
		private bool IsNumeric (string strNum)
		{	
			int iNum;
			try
			{
				iNum = int.Parse(strNum);
				return true;
			}
			catch
			{
				return false;
			}
		}
		private int kiemtrangay(int dtemp,int y)
		{
			int d=0;
			
			switch(dtemp)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:
					d=31;
					break;
				case 2:
					if((y%4)==0)
						d=29;
					else if((y%4)!=0)
						d=28;
					break;
				case 4:
				case 6:
				case 9:
				case 11:
					d=30;
					break;
			}
			return d;
		}
		private void load_LBL()
		{	
			string ma_nv1=lblMasoNVCT.Text.ToString();
			string ho_nv=lblHoTenNVCT.Text.ToString();
			string bophan_nv=lblTenPhongCT.Text.ToString();
            sql = "SELECT l.manv,l.mnvmay,l.ho||' '||l.ten as ho_t,b.tenbp FROM " + m_user + ".llnv l," + m_user + ".bophan b where l.manv ='" + ma_nv1 + "' and l.madv=b.madv ";			
			DataSet ads=mDB.get_data(sql);
			DataRow[] r=ads.Tables[0].Select("manv='" + ma_nv1+"'");							
			if(lblMasoNVCT.Text=="".ToString())
			{
				lblMasoNVCT.Text="00000".ToString();
				goicb();				
			}
			else 
			{
				lblMasoNVCT.Text=v_manv;
				lblHoTenNVCT.Text=v_ho;
				lblTenPhongCT.Text=v_bophan;
					
				load_doanthe(v_manv,v_ho,v_bophan);
			}						
		}

		private void load_LBL(string v_manv,string v_ho,string v_bophan)
		{
			try
			{
				v_manv=get_llnvmanv;
				v_ho=get_llnvmanv1;
				v_bophan=get_llnvmanv2;
				if (lblMasoNVCT.Text.Trim()=="".ToString())
				{
					lblMasoNVCT.Text="00000";					
				}
				else
				{
					lblMasoNVCT.Text=v_manv;
					lblHoTenNVCT.Text=v_ho;
					lblTenPhongCT.Text=v_bophan;
					load_LBL();//get_llnvmanv,get_llnvmanv1,get_llnvmanv2);								
				}
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
			}
		}
		private void butHuy_Click(object sender, System.EventArgs e)
		{
			DataSet ds=new DataSet();
			string ma_nv=lblMasoNVCT.Text;
			DialogResult dr = MessageBox.Show(lan.Change_language_MessageText("Đồng ý xoá nhân viên này?"),AccessData.Msg,MessageBoxButtons.YesNo);			
			if(dr == DialogResult.Yes) 			
			{	
				try
				{					
					f_DelDTllnv(ma_nv);
					f_DelDThd(ma_nv);					
					ds=mDB.f_countNV();
					TSo=ds.Tables[0].Rows[0][0].ToString();
					txtTSo.Text="";
					txtTSo.Text=TSo.ToString();
					goicb();			
					cboTPXT_DT.SelectedIndex=-1;
					cboTPBT_DT.SelectedIndex=-1;
					cboNG_DT.SelectedIndex=-1;
					cboDTCT_DT.SelectedIndex=-1;
                    //moi thhem
                    cbo_chibodt.SelectedIndex = -1;
                    cbo_tocdoan.SelectedIndex = -1;
                    cbo_todoan.SelectedIndex = -1;
                    cbo_dagcvvq.SelectedIndex = -1;
                    cbo_doanthecvvq.SelectedIndex = -1;
                    cbo_cqcvvq.SelectedIndex = -1;
                    cbo_dagcvht.SelectedIndex = -1;
                    cbo_doanthecvht.SelectedIndex = -1;
                    cbo_cqcvht.SelectedIndex = -1;
                    

					MessageBox.Show(lan.Change_language_MessageText("Đã Hủy"));	
				}
				catch {}
			}			
		
		}

		private void cboTPXT_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cboTPBT_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cboNG_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void txtNTGCM_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void txtNTGCM_DT_Validated(object sender, System.EventArgs e)
		{
			string ma_nv2=lblMasoNVCT.Text.Trim();
			DataSet dshd=new DataSet();
			dshd=mDB.LyLichNV(lblMasoNVCT.Text);							
			DataRow[] rhd=dshd.Tables[0].Select("mnvmay= '"+ma_nv2+"'");
			dtpNgaySinh.Text=rhd[0]["ngaysinh"].ToString();
            txtNTGCM_DT.Text = txtNTGCM_DT.Text.Trim();
            if (txtNTGCM_DT.Text == "  /  /")
            {
                return;
            }
            if (!mDB.kiemtrangayhople(txtNTGCM_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg,MessageBoxButtons.OK,MessageBoxIcon.Warning);
                txtNTGCM_DT.Focus();
                return;
            }
			if(txtNTGCM_DT.Text!="" && txtNTGCM_DT.Text!="__/__/____")
			{
				if(txtNTGCM_DT.Text.IndexOf("_")>0 && txtNTGCM_DT.Text!="")
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm tham gia CM"),AccessData.Msg);
					txtNTGCM_DT.Focus();
					return ;
				}
				int dd=0,mm=0,yy=0;

				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(txtNTGCM_DT.Text.Substring(0,2));
					mmns=int.Parse(txtNTGCM_DT.Text.Substring(3,2));
					yyns=int.Parse(txtNTGCM_DT.Text.Substring(6,4));
				}
				catch{}

				dd=int.Parse(dtpNgaySinh.Text.Substring(0,2));
				mm=int.Parse(dtpNgaySinh.Text.Substring(3,2));
				yy=int.Parse(dtpNgaySinh.Text.Substring(6));
				int ytemp=0;
				ytemp=yyns + 14;
				try
				{
					if(yy>=ytemp)
					{
						MessageBox.Show(lan.Change_language_MessageText("Năm sinh ")+ dtpNgaySinh +lan.Change_language_MessageText(" phải nhỏ hơn ngày tham gia CM và đủ 14 tuổi trở lên"),AccessData.Msg);
						txtNTGCM_DT.Focus();
						return;
					}
				}
				catch{}
				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tham gia CM không hợp lệ"),AccessData.Msg);
					txtNTGCM_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng tham gia CM không hợp lệ"),AccessData.Msg);
					txtNTGCM_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tham gia CM không hợp lệ"),AccessData.Msg);
					txtNTGCM_DT.Focus();
					return;
				}
			}
		}

		private void txtNTL_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNTL_DT_Validated(object sender, System.EventArgs e)
		{
            txtNTL_DT.Text = txtNTL_DT.Text.Trim();
            if (txtNTL_DT.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtNTL_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtNTL_DT.Focus();
                return;
            }
            if(txtNTL_DT.Text!="" && txtNTL_DT.Text!="__/__/____")
			{
				if(txtNTL_DT.Text.IndexOf("_")>0 && txtNTL_DT.Text!="")
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm ngày thoát ly"),AccessData.Msg);
					txtNTL_DT.Focus();
					return ;
				}
				int dd=0,mm=0,yy=0;

				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(txtNTL_DT.Text.Substring(0,2));
					mmns=int.Parse(txtNTL_DT.Text.Substring(3,2));
					yyns=int.Parse(txtNTL_DT.Text.Substring(6,4));
				}
				catch{}

				dd=int.Parse(txtNTGCM_DT.Text.Substring(0,2));
				mm=int.Parse(txtNTGCM_DT.Text.Substring(3,2));
				yy=int.Parse(txtNTGCM_DT.Text.Substring(6));
				
				try
				{					
					if(yyns<yy)
					{
						MessageBox.Show(lan.Change_language_MessageText("Năm của ngày tham gia CM ") + txtNTGCM_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn năm của đến ngày thoát ly"),AccessData.Msg);
						txtNTL_DT.Focus();
						return;
					}					
					if(yyns==yy)
					{
						if(mmns<mm)
						{
							MessageBox.Show(lan.Change_language_MessageText("Tháng của ngày tham gia CM ") + txtNTGCM_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn tháng của đến ngày thoát ly"),AccessData.Msg);
							txtNTL_DT.Focus();
							return;
						}
						if(mmns==mm)
						{
							if(ddns<dd)
							{
								MessageBox.Show(lan.Change_language_MessageText("Ngày của từ ngày tham gia CM ") + txtNTGCM_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn ngày của đến ngày thoát ly"),AccessData.Msg);
								txtNTL_DT.Focus();
								return;
							}
						}
					}
				}
				catch{}
				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày thoát ly không hợp lệ"),AccessData.Msg);
					txtNTL_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày thoát ly không hợp lệ"),AccessData.Msg);
					txtNTL_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày thoát ly không hợp lệ"),AccessData.Msg);
					txtNTL_DT.Focus();
					return;
				}
			}
		}

		private void txtDang_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
                if (txtDang_DT.Text.Trim().Equals("C"))
                    txtDoan_DT.Focus();
                else
				    SendKeys.Send("{Tab}");	
		}

		private void txtDang_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtSTD_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtSTD_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtNDB_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			try
			{
				if (e.KeyCode==Keys.Enter)
					SendKeys.Send("{Tab}");	
			}
			catch{}
		}

		private void txtNDB_DT_Validated(object sender, System.EventArgs e)
		{
			try
			{
				string ma_nv2=lblMasoNVCT.Text;
				DataSet dshd=new DataSet();
				dshd=mDB.LyLichNV(lblMasoNVCT.Text);							
				DataRow[] rhd=dshd.Tables[0].Select("mnvmay= '"+ma_nv2+"'");
				dtpNgaySinh.Text=rhd[0]["ngaysinh"].ToString();
                txtNDB_DT.Text = txtNDB_DT.Text.Trim();
                if (txtNDB_DT.Text == "  /  /") return;
                if (!mDB.kiemtrangayhople(txtNDB_DT.Text))
                {
                    MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtNDB_DT.Focus();
                    return;
                }
				if(txtNDB_DT.Text!="" && txtNDB_DT.Text!="__/__/____")
				{
					if(txtNDB_DT.Text.IndexOf("_")>0 && txtNDB_DT.Text!="")
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm dự bị"),AccessData.Msg);
						txtNDB_DT.Focus();
						return ;
					}
					int dd=0,mm=0,yy=0;

					int ddns=0,mmns=0,yyns=0;				
					try
					{					
						ddns=int.Parse(txtNDB_DT.Text.Substring(0,2));
						mmns=int.Parse(txtNDB_DT.Text.Substring(3,2));
						yyns=int.Parse(txtNDB_DT.Text.Substring(6,4));
					}
					catch//(Exception ex)
					{
						//MessageBox.Show(ex.ToString());
					}

					dd=int.Parse(dtpNgaySinh.Text.Substring(0,2));
					mm=int.Parse(dtpNgaySinh.Text.Substring(3,2));
					yy=int.Parse(dtpNgaySinh.Text.Substring(6));
					int ytemp=0;
					ytemp=yyns + 14;
					try
					{
						if(yy>=ytemp)
						{
							MessageBox.Show(lan.Change_language_MessageText("Năm sinh phải nhỏ hơn ngày dự bị và đủ 14 tuổi trở lên"),AccessData.Msg);
							txtNDB_DT.Focus();
							return;
						}
					}
					catch//(Exception ex)
					{
						//MessageBox.Show(ex.ToString());
					}
					if(dd<=0 || dd >31)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày dự bị không hợp lệ"),AccessData.Msg);
						txtNDB_DT.Focus();
						return;
					}
					if(mm<=0 || mm>12)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập tháng dự bị không hợp lệ"),AccessData.Msg);
						txtNDB_DT.Focus();
						return;
					}
					if(dd > kiemtrangay(mm,yy))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày dự bị không hợp lệ"),AccessData.Msg);
						txtNDB_DT.Focus();
						return;
					}
				}
			}
			catch{}
		}

		private void txtNCT_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNCT_DT_Validated(object sender, System.EventArgs e)
		{
			try
			{
                txtNCT_DT.Text = txtNCT_DT.Text.Trim();
                if (txtNCT_DT.Text == "  /  /") return;
                if (!mDB.kiemtrangayhople(txtNCT_DT.Text))
                {
                    MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtNCT_DT.Focus();
                    return;
                }
                if(txtNCT_DT.Text!="" && txtNCT_DT.Text!="__/__/____")
				{
					if(txtNCT_DT.Text.IndexOf("_")>0 && txtNCT_DT.Text!="")
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm ngày chính thức"),AccessData.Msg);
						txtNCT_DT.Focus();
						return ;
					}
					int dd=0,mm=0,yy=0;

					int ddns=0,mmns=0,yyns=0;				
					try
					{					
						ddns=int.Parse(txtNCT_DT.Text.Substring(0,2));
						mmns=int.Parse(txtNCT_DT.Text.Substring(3,2));
						yyns=int.Parse(txtNCT_DT.Text.Substring(6,4));
					}
					catch//(Exception ex)
					{
						//MessageBox.Show(ex.ToString());
					}

					dd=int.Parse(txtNDB_DT.Text.Substring(0,2));
					mm=int.Parse(txtNDB_DT.Text.Substring(3,2));
					yy=int.Parse(txtNDB_DT.Text.Substring(6));
				
					try
					{					
						if(yyns<yy)
						{
							MessageBox.Show(lan.Change_language_MessageText("Năm của ngày dự bị") + txtNDB_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn năm của ngày chính thức"),AccessData.Msg);
							txtNCT_DT.Focus();
							return;
						}					
						if(yyns==yy)
						{
							if(mmns<mm)
							{
								MessageBox.Show(lan.Change_language_MessageText("Tháng của ngày dự bị") + txtNDB_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn tháng của ngày chính thức"),AccessData.Msg);
								txtNCT_DT.Focus();
								return;
							}
							if(mmns==mm)
							{
								if(ddns<dd)
								{
									MessageBox.Show(lan.Change_language_MessageText("Ngày của từ ngày dự bị") + txtNDB_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn ngày của ngày chính thức"),AccessData.Msg);
									txtNCT_DT.Focus();
									return;
								}
							}
						}
					}
					catch{}
					if(dd<=0 || dd >31)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày chính thức không hợp lệ"),AccessData.Msg);
						txtNCT_DT.Focus();
						return;
					}
					if(mm<=0 || mm>12)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày chính thức không hợp lệ"),AccessData.Msg);
						txtNCT_DT.Focus();
						return;
					}
					if(dd > kiemtrangay(mm,yy))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày chính thức không hợp lệ"),AccessData.Msg);
						txtNCT_DT.Focus();
						return;
					}
				}
			}
			catch{}
		}

		private void txtCB_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtCB_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled = true;			
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtNCD_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNCD_DT_Validated(object sender, System.EventArgs e)
		{
			string ma_nv2=lblMasoNVCT.Text;
			DataSet dshd=new DataSet();
			dshd=mDB.LyLichNVhd(lblMasoNVCT.Text);							
			DataRow[] rhd=dshd.Tables[0].Select("manv= '"+ma_nv2+"'");
			dtpNgayCongTac.Text=rhd[0]["m_ngaydenct"].ToString();
            txtNCD_DT.Text = txtNCD_DT.Text.Trim();
            if (txtNCD_DT.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtNCD_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtNCD_DT.Focus();
                return;
            }
			if(txtNCD_DT.Text!="" && txtNCD_DT.Text!="__/__/____")
			{
				if(txtNCD_DT.Text.IndexOf("_")>0 && txtNCD_DT.Text!="")
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm"),AccessData.Msg);
					txtNCD_DT.Focus();
					return ;
				}
				int dd=0,mm=0,yy=0;
				dd=int.Parse(txtNCD_DT.Text.Substring(0,2));
				mm=int.Parse(txtNCD_DT.Text.Substring(3,2));
				yy=int.Parse(txtNCD_DT.Text.Substring(6));

				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(dtpNgayCongTac.Text.Substring(0,2));
					mmns=int.Parse(dtpNgayCongTac.Text.Substring(3,2));
					yyns=int.Parse(dtpNgayCongTac.Text.Substring(6,4));
				}
				catch{}
				try
				{
					if(yy<yyns)
					{
						MessageBox.Show(lan.Change_language_MessageText("Năm của ngày đến công tác ") + dtpNgayCongTac.Text + lan.Change_language_MessageText(" phải nhỏ hơn năm ngày chuyển đến"),AccessData.Msg);
						txtNCD_DT.Focus();
						return;
					}
					if(yy==yyns)
					{
						if(mm<mmns)
						{
							MessageBox.Show(lan.Change_language_MessageText("Tháng của ngày đến công tác ") + dtpNgayCongTac.Text + lan.Change_language_MessageText(" phải nhỏ hơn tháng của ngày chuyển đến"),AccessData.Msg);
							txtNCD_DT.Focus();
							return;
						}
						if(mm==mmns)
						{
							if(dd<ddns)
							{
								MessageBox.Show(lan.Change_language_MessageText("Ngày của ngày đến công tác ") + dtpNgayCongTac.Text + lan.Change_language_MessageText(" phải nhỏ hơn ngày chuyển đến"),AccessData.Msg);
								txtNCD_DT.Focus();
								return;
							}
						}
					}
				}
				catch{}

				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
					txtNCD_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
					txtNCD_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),AccessData.Msg);
					txtNCD_DT.Focus();
					return;
				}
			}			
		}

		private void cboDTCT_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void txtNTN_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNTN_DT_Validated(object sender, System.EventArgs e)
		{
            txtNTN_DT.Text = txtNTN_DT.Text.Trim();
            if (txtNTN_DT.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtNTN_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtNTN_DT.Focus();
                return;
            }
            if(txtNTN_DT.Text!="" && txtNTN_DT.Text!="__/__/____")
			{
				if(txtNTN_DT.Text.IndexOf("_")>0 && txtNTN_DT.Text!="")
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm "),AccessData.Msg);
					txtNTN_DT.Focus();
					return ;
				}
				int dd=0,mm=0,yy=0;
				dd=int.Parse(txtNTN_DT.Text.Substring(0,2));
				mm=int.Parse(txtNTN_DT.Text.Substring(3,2));
				yy=int.Parse(txtNTN_DT.Text.Substring(6));				
				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
					txtNTN_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
					txtNTN_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),AccessData.Msg);
					txtNTN_DT.Focus();
					return;
				}
			}			
		}

		private void txtCD_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
                if (txtCD_DT.Text.Trim().Equals("C"))
                    txtDoan_DT.Focus();
                else
                    SendKeys.Send("{Tab}");	
		}

		private void txtCD_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;			
		}

		private void txtTo1_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtTo1_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled = true;			
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtST1_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtST1_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;		
		}

		private void txtNKN_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNKN_DT_Validated(object sender, System.EventArgs e)
		{
			try
			{
				string ma_nv2=lblMasoNVCT.Text;
				DataSet dshd=new DataSet();
				dshd=mDB.LyLichNV(ma_nv2);							
				DataRow[] rhd=dshd.Tables[0].Select("manv= '"+ma_nv2+"'");
				dtpNgayCapCMND.Text=rhd[0]["ngaycapcmnd"].ToString();
                txtNKN_DT.Text = txtNKN_DT.Text.Trim();
                if (txtNKN_DT.Text == "  /  /") return;
                if (!mDB.kiemtrangayhople(txtNKN_DT.Text))
                {
                    MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtNKN_DT.Focus();
                    return;
                }
				if(txtNKN_DT.Text!="" && txtNKN_DT.Text!="__/__/____")
				{
					if(txtNKN_DT.Text.IndexOf("_")>0 && txtNKN_DT.Text!="")
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm "),AccessData.Msg);
						txtNKN_DT.Focus();
						return ;
					}
					int dd=0,mm=0,yy=0;

					int ddns=0,mmns=0,yyns=0;				
					try
					{					
						ddns=int.Parse(txtNKN_DT.Text.Substring(0,2));
						mmns=int.Parse(txtNKN_DT.Text.Substring(3,2));
						yyns=int.Parse(txtNKN_DT.Text.Substring(6,4));
					}
					catch{}

					dd=int.Parse(dtpNgayCapCMND.Text.Substring(0,2));
					mm=int.Parse(dtpNgayCapCMND.Text.Substring(3,2));
					yy=int.Parse(dtpNgayCapCMND.Text.Substring(6));
					int ytemp=0;
					ytemp=yyns + 14;
					try
					{
						if(yy>=ytemp)
						{
							MessageBox.Show(lan.Change_language_MessageText("Năm cấp CMND phải nhỏ hơn ngày kết nạp và đủ 14 tuổi trở lên"),AccessData.Msg);
							txtNKN_DT.Focus();
							return;
						}
					}
					catch//(Exception ex)
					{
						//MessageBox.Show(ex.ToString());
					}
					if(dd<=0 || dd >31)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày kết nạp không hợp lệ"),AccessData.Msg);
						txtNKN_DT.Focus();
						return;
					}
					if(mm<=0 || mm>12)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập tháng kết nạp không hợp lệ"),AccessData.Msg);
						txtNKN_DT.Focus();
						return;
					}
					if(dd > kiemtrangay(mm,yy))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày kết nạp không hợp lệ"),AccessData.Msg);
						txtNKN_DT.Focus();
						return;
					}
				}
			}
			catch{}
		}

		private void txtCDP_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtCDP_DT_Validated(object sender, System.EventArgs e)
		{
			try
			{
                txtCDP_DT.Text = txtCDP_DT.Text.Trim();
                if (txtCDP_DT.Text == "  /  /") return;
                if (!mDB.kiemtrangayhople(txtCDP_DT.Text))
                {
                    MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCDP_DT.Focus();
                    return;
                }
                if(txtCDP_DT.Text!="" && txtCDP_DT.Text!="__/__/____")
				{
					
					int dd=0,mm=0,yy=0;
					dd=int.Parse(txtCDP_DT.Text.Substring(0,2));
					mm=int.Parse(txtCDP_DT.Text.Substring(3,2));
					yy=int.Parse(txtCDP_DT.Text.Substring(6));

					int ddns=0,mmns=0,yyns=0;				
					try
					{					
						ddns=int.Parse(txtNKN_DT.Text.Substring(0,2));
						mmns=int.Parse(txtNKN_DT.Text.Substring(3,2));
						yyns=int.Parse(txtNKN_DT.Text.Substring(6,4));
					}
					catch{}
					try
					{
						if(yy<yyns)
						{
							MessageBox.Show(lan.Change_language_MessageText("Năm của ngày kết nạp") + txtNKN_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn năm ngày đoàn phí"),AccessData.Msg);
							txtCDP_DT.Focus();
							return;
						}
						if(yy==yyns)
						{
							if(mm<mmns)
							{
								MessageBox.Show(lan.Change_language_MessageText("Tháng của ngày kết nạp") + txtNKN_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn tháng của ngày đoàn phí"),AccessData.Msg);
								txtCDP_DT.Focus();
								return;
							}
							if(mm==mmns)
							{
								if(dd<ddns)
								{
									MessageBox.Show(lan.Change_language_MessageText("Ngày của ngày kết nạp") + txtNKN_DT.Text + lan.Change_language_MessageText(" phải nhỏ hơn ngày đoàn phí"),AccessData.Msg);
									txtCDP_DT.Focus();
									return;
								}
							}
						}
					}
					catch{}

					if(dd<=0 || dd >31)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
						txtCDP_DT.Focus();
						return;
					}
					if(mm<=0 || mm>12)
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
						txtCDP_DT.Focus();
						return;
					}
					if(dd > kiemtrangay(mm,yy))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),AccessData.Msg);
						txtCDP_DT.Focus();
						return;
					}
				}	
			}
			catch{}
		}

		private void txtDoan_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
            {
                if (txtDoan_DT.Text.Trim().Equals("C"))
                    if (txtDang_DT.Text.Trim().Equals("C"))
                        cbo_dagcvvq.Focus();
                    else
                        butThem.Focus();
                else
                    SendKeys.Send("{Tab}");
            }
		}

		private void txtDoan_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;			
		}

		private void txtTo2_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtTo2_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled = true;			
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtST2_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtST2_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtNVD_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNVD_DT_Validated(object sender, System.EventArgs e)
		{
			string ma_nv2=lblMasoNVCT.Text;
			DataSet dshd=new DataSet();
			dshd=mDB.LyLichNV(ma_nv2);							
			DataRow[] rhd=dshd.Tables[0].Select("mnvmay= '"+ma_nv2+"'");
			dtpNgayCapCMND.Text=rhd[0]["ngaycapcmnd"].ToString();
            txtNVD_DT.Text = txtNVD_DT.Text.Trim();
            if (txtNVD_DT.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtNVD_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtNVD_DT.Focus();
                return;
            }
			if(txtNVD_DT.Text!="" && txtNVD_DT.Text!="__/__/____")
			{
				if(txtNVD_DT.Text.IndexOf("_")>0 && txtNVD_DT.Text!="")
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm"),AccessData.Msg);
					txtNVD_DT.Focus();
					return ;
				}
				int dd=0,mm=0,yy=0;

				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(txtNVD_DT.Text.Substring(0,2));
					mmns=int.Parse(txtNVD_DT.Text.Substring(3,2));
					yyns=int.Parse(txtNVD_DT.Text.Substring(6,4));
				}
				catch{}

                dd = int.Parse(txtNVD_DT.Text.Substring(0, 2));
                mm = int.Parse(txtNVD_DT.Text.Substring(3, 2));
                yy = int.Parse(txtNVD_DT.Text.Substring(6));
                int ytemp = 0;
                ytemp = yyns + 14;
                try
                {
                    if (yy >= ytemp)
                    {
                        MessageBox.Show(lan.Change_language_MessageText("Năm cấp CMND phải nhỏ hơn ngày vào đoàn và đủ 14 tuổi trở lên"), AccessData.Msg);
                        txtNVD_DT.Focus();
                        return;
                    }
                }
                catch//(Exception ex)
                {
                    //MessageBox.Show(ex.ToString());
                }
				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày vào đoàn không hợp lệ"),AccessData.Msg);
					txtNVD_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng vào đoàn không hợp lệ"),AccessData.Msg);
					txtNVD_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày vào đoàn không hợp lệ"),AccessData.Msg);
					txtNVD_DT.Focus();
					return;
				}
			}
		}

		private void txtNCDen_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtNCDen_DT_Validated(object sender, System.EventArgs e)
		{
			string ma_nv2=lblMasoNVCT.Text;
			DataSet dshd=new DataSet();
			dshd=mDB.LyLichNVhd(lblMasoNVCT.Text);							
			DataRow[] rhd=dshd.Tables[0].Select("manv= '"+ma_nv2+"'");
			dtpNgayCongTac.Text=rhd[0]["m_ngaydenct"].ToString();
            txtNCDen_DT.Text = txtNCDen_DT.Text.Trim();
            if (txtNCDen_DT.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtNCDen_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtNCDen_DT.Focus();
                return;
            }
			if(txtNCDen_DT.Text!="" && txtNCDen_DT.Text!="__/__/____")
			{
				
				int dd=0,mm=0,yy=0;
				dd=int.Parse(txtNCDen_DT.Text.Substring(0,2));
				mm=int.Parse(txtNCDen_DT.Text.Substring(3,2));
				yy=int.Parse(txtNCDen_DT.Text.Substring(6));

				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(dtpNgayCongTac.Text.Substring(0,2));
					mmns=int.Parse(dtpNgayCongTac.Text.Substring(3,2));
					yyns=int.Parse(dtpNgayCongTac.Text.Substring(6,4));
				}
				catch{}
				try
				{
					if(yy<yyns)
					{
						MessageBox.Show(lan.Change_language_MessageText("Năm của ngày đến công tác ") + dtpNgayCongTac.Text + lan.Change_language_MessageText(" phải nhỏ hơn năm ngày chuyển đến"),AccessData.Msg);
						txtNCDen_DT.Focus();
						return;
					}
					if(yy==yyns)
					{
						if(mm<mmns)
						{
							MessageBox.Show(lan.Change_language_MessageText("Tháng của ngày đến công tác ") + dtpNgayCongTac.Text + lan.Change_language_MessageText(" phải nhỏ hơn tháng của ngày chuyển đến"),AccessData.Msg);
							txtNCDen_DT.Focus();
							return;
						}
						if(mm==mmns)
						{
							if(dd<ddns)
							{
								MessageBox.Show(lan.Change_language_MessageText("Ngày của ngày đến công tác ") + dtpNgayCongTac.Text + lan.Change_language_MessageText(" phải nhỏ hơn ngày chuyển đến"),AccessData.Msg);
								txtNCDen_DT.Focus();
								return;
							}
						}
					}
				}
				catch{}

				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
					txtNCDen_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng không hợp lệ"),AccessData.Msg);
					txtNCDen_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),AccessData.Msg);
					txtNCDen_DT.Focus();
					return;
				}
			}			
		}

		private void txtDP_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txtDP_DT_Validated(object sender, System.EventArgs e)
		{
            txtDP_DT.Text = txtDP_DT.Text.Trim();
            if (txtDP_DT.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtDP_DT.Text))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm không hợp lệ!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtDP_DT.Focus();
                return;
            }
            if(txtDP_DT.Text!="" && txtDP_DT.Text!="__/__/____")
			{
				if(txtDP_DT.Text.IndexOf("_")>0 && txtDP_DT.Text!="")
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày tháng năm"),AccessData.Msg);
					txtDP_DT.Focus();
					return ;
				}
				int dd=0,mm=0,yy=0;

				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(txtDP_DT.Text.Substring(0,2));
					mmns=int.Parse(txtDP_DT.Text.Substring(3,2));
					yyns=int.Parse(txtDP_DT.Text.Substring(6,4));
				}
				catch//(Exception ex)
				{
					//MessageBox.Show(ex.ToString());
				}

				dd=int.Parse(txtNVD_DT.Text.Substring(0,2));
				mm=int.Parse(txtNVD_DT.Text.Substring(3,2));
				yy=int.Parse(txtNVD_DT.Text.Substring(6));
				
				try
				{
					if(yy>yyns)
					{
						MessageBox.Show(lan.Change_language_MessageText("Năm ngày vào đoàn nhỏ hơn năm ngày tính đoàn phí"),AccessData.Msg);
						txtDP_DT.Focus();
						return;
					}
					if(yy==yyns)
					{
						if(mm<mmns)
						{
							MessageBox.Show(lan.Change_language_MessageText("Tháng vào đoàn ngày phải nhỏ hơn tháng đoàn phí"),AccessData.Msg);
							txtDP_DT.Focus();
							return;
						}
						if(mm==mmns)
						{
							if(dd<ddns)
							{
								MessageBox.Show(lan.Change_language_MessageText("Ngày vào đoàn phải nhỏ hơn ngày đoàn phí"),AccessData.Msg);
								txtDP_DT.Focus();
								return;
							}
						}
					}
				}
				catch {}
				if(dd<=0 || dd >31)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg);
					txtDP_DT.Focus();
					return;
				}
				if(mm<=0 || mm>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),AccessData.Msg);
					txtDP_DT.Focus();
					return;
				}
				if(dd > kiemtrangay(mm,yy))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg);
					txtDP_DT.Focus();
					return;
				}
			}
		}

		private void txtDcvvq_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtDcvvq_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtDTcvvq_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtCQcvvq_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtCQcvvq_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtDcvht_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtDcvht_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtDTcvht_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}
		private void txtCQcvht_DT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
			{
				butThem.Focus();
			}
		}

		private void txtCQcvht_DT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void frmDoanTheSua_Load(object sender, System.EventArgs e)
		{
			Load_DT();
            load_doanthe();
            if (cboTPXT_DT.SelectedIndex != -1)
            {
                setcontrol(false);
            }
            butEdit.Enabled = admin;
            butHuy.Enabled = admin;
		}

        public void setcontrol(bool av)
        {
            group.Enabled = av;
            butThem.Enabled = av;
            butEdit.Enabled = !av;
            butHuy.Enabled = !av;
        }
		private void ThanhphanXT()
		{
			cboTPXT_DT.DisplayMember="thanhphan";
			cboTPXT_DT.ValueMember="thanhphan";
			cboTPXT_DT.DataSource=mDB.get_data("SELECT * FROM "+m_user+".xuatthan").Tables[0];
		}
        //load chibo
        private void dmchibo(string nhom,ComboBox cb_canhienthi)
        {
            string sql = "";
            sql = " select * from "+m_user+".dmchibo";
            sql += " where nhom='"+nhom+"'";
            cb_canhienthi.DisplayMember = "ten";
            cb_canhienthi.ValueMember = "ma";
            cb_canhienthi.DataSource = mDB.get_data(sql).Tables[0];
            cb_canhienthi.SelectedIndex = -1;
        }
        //load dmchucvudang 
        private void dmchucvudang(string nhom,ComboBox cb_canhienthi)
        {
            string sql = "";
            sql = " select * from " + m_user +".dmchucvudang ";
            sql += " where nhom='"+nhom+"'";
            cb_canhienthi.DisplayMember = "ten";
            cb_canhienthi.ValueMember = "ma";
            cb_canhienthi.DataSource = mDB.get_data(sql).Tables[0];
            cb_canhienthi.SelectedIndex = -1;
        }
        //load dmcv
        private void dmcv(ComboBox cb_hienthi)
        {
            string sql = "";
            sql = " select macv,diengiai from " + m_user + ".dmcv";
            cb_hienthi.DisplayMember = "diengiai";
            cb_hienthi.ValueMember = "macv";
            cb_hienthi.DataSource = mDB.get_data(sql).Tables[0];
             cb_hienthi.SelectedIndex = -1;
        }
		private void ThanhphanBT()
		{
			cboTPBT_DT.DisplayMember="thanhphan";
			cboTPBT_DT.ValueMember="thanhphan";
			cboTPBT_DT.DataSource=mDB.get_data("SELECT * FROM "+m_user+". xuatthan").Tables[0];
		}
		private void Nguongoc()
		{
			cboNG_DT.DisplayMember="ten";
			cboNG_DT.ValueMember="ten";
			cboNG_DT.DataSource=mDB.get_data("SELECT * FROM "+m_user+". dmNguonGoc").Tables[0];
		}
		private void DTChinhTri()
		{
			cboDTCT_DT.DisplayMember="ten";
			cboDTCT_DT.ValueMember="ten";
			cboDTCT_DT.DataSource=mDB.get_data("SELECT * FROM "+m_user+". dmDTCTri").Tables[0];
		}

		private void butKetThuc_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void txtDang_DT_Validated(object sender, System.EventArgs e)
		{
			if((txtDang_DT.Text!="c"))
				if(txtDang_DT.Text!="C")
					if(txtDang_DT.Text!="r")
						if(txtDang_DT.Text!="R")
							if(txtDang_DT.Text!="") 
							{
								MessageBox.Show(lan.Change_language_MessageText("Nhập vào đảng R(rồi) hay C(chưa) hay rỗng"),AccessData.Msg);					
								txtDang_DT.Focus();
								txtDang_DT.Text="";
							}
           
		}

		private void txtCD_DT_Validated(object sender, System.EventArgs e)
		{
			if((txtCD_DT.Text!="c"))
				if(txtCD_DT.Text!="C")
					if(txtCD_DT.Text!="r")
						if(txtCD_DT.Text!="R")
							if(txtCD_DT.Text!="") 
							{
								MessageBox.Show(lan.Change_language_MessageText("Nhập vào đảng R(rồi) hay C(chưa) hay rỗng"),AccessData.Msg);					
								txtCD_DT.Focus();
								txtCD_DT.Text="";
							}
		}

		private void txtDoan_DT_Validated(object sender, System.EventArgs e)
		{
			if((txtDoan_DT.Text!="c"))
				if(txtDoan_DT.Text!="C")
					if(txtDoan_DT.Text!="r")
						if(txtDoan_DT.Text!="R")
							if(txtDoan_DT.Text!="") 
							{
								MessageBox.Show(lan.Change_language_MessageText("Nhập vào đảng R(rồi) hay C(chưa) hay rỗng"),AccessData.Msg);					
								txtDoan_DT.Focus();
								txtDoan_DT.Text="";
							}
		}
        private  DataSet f_Dthopdong(string ma_nv)
        {
            sql = "SELECT MANV,MANVMAY,DANG,THEDANG," +
                " to_char(CHUYEN_DEN,'dd/mm/yyyy') as m_chuyen_den," +
                " CONG_DOAN,THE_CDOAN," +
                " to_char(CDOANPHI,'dd/mm/yyyy') as m_cdoanphi," +
                " to_char(VAO_CDOAN,'dd/mm/yyyy') as m_vao_cdoan,DOAN," +
                " to_char(DOAN_DEN,'dd/mm/yyyy') as m_doan_den," +
                " THEDOAN," +
                " to_char(DOANPHI,'dd/mm/yyyy') as m_doanphi," +
                //" MAX_DANG,MAX_DOAN,MAX_CQUYEN,CMAX_DANG,CMAX_DOAN,CMAX_QUYEN" +

                " cb.ten as chi_bo,cb1.ten as to_t,cb2.ten as todoan,d.ten as max_dang,d1.ten as max_doan,d2.ten as cmax_doan" +
                ",d3.ten as cmax_dang,cv.diengiai as max_cquyen,cv1.diengiai as cmax_quyen" +
                " FROM " + mDB.user + ".hopdong h " +
                " left join " + mDB.user + ".dmchibo cb on h.chi_bo=cb.ma" +
                " left join " + mDB.user + ".dmchibo cb1 on h.to_t =cb1.ma" +
                " left join " + mDB.user + ".dmchibo cb2 on h.todoan=cb2.ma" +

                " left join " + mDB.user + ".dmchucvudang d on h.max_dang=d.ma" +
                " left join " + mDB.user + ".dmchucvudang d1 on h.max_doan=d1.ma" +
                " left join " + mDB.user + ".dmchucvudang d2 on h.cmax_doan=d2.ma" +
                " left join " + mDB.user + ".dmchucvudang d3 on h.cmax_dang=d3.ma" +

                " left join " + mDB.user + ".dmcv cv on h.max_cquyen=cv.macv" +
                " left join " + mDB.user + ".dmcv cv1 on h.cmax_quyen=cv1.macv" +
                " WHERE manv='" + ma_nv.Trim() + "'";

            return mDB.get_data(sql);
        }
        private bool f_DelDTllnv(string ma)
        {
            sql = "UPDATE "+m_user+".llnv SET chinhtri='',nguongoc='',ngay_t_gia=null,";
            sql += " ngay_t_ly=null,ngay_doan=null,dubi_dang=null,cthuc_dang=null,";
            sql += " tp_x_than='',tp_b_than='',ngay_tn=null WHERE manv='" + ma + "'";
            return mDB.Execute_data(sql);
        }
        public bool f_DelDThd(string ma)
        {
            sql = "UPDATE " + m_user + ".hopdong SET dang='',thedang='',chuyen_den=null,chi_bo='',";
            sql += " cong_doan='',To_t='',the_cdoan='',cdoanphi=null,vao_cdoan=null,";
            sql += " doan='',doan_den=null,todoan='',thedoan='',doanphi=null,";
            sql += " max_dang='',max_doan='',max_cquyen='',cmax_dang='',cmax_doan='',";
            sql += " cmax_quyen='',ngaychuyendi_dang=null,noichuyendi_dang='',noichuyenden_dang=''  WHERE manv='" + ma + "'";
            return mDB.Execute_data(sql);
        }

        private void butEdit_Click(object sender, EventArgs e)
        {
            setcontrol(true);
            butEdit.Enabled = admin;
            butHuy.Enabled = admin;
        }

        private void txtNCDi_DT_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
        }

        private void txtnoiCDi_DT_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
        }

        private void txtNoiCD_DT_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
        }

        private void txtNCDi_DT_Validated(object sender, EventArgs e)
        {
            if (txtNCDi_DT.Text == "  /  /") return;
            if(! mDB.kiemtrangayhople(txtNCDi_DT.Text.Trim()))
            {
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg,MessageBoxButtons.OK,MessageBoxIcon.Warning);
                txtNCDi_DT.Focus();
                return;
            }
        }

        private void frmDoanThe_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Alt && e.KeyCode == Keys.T)
            {
                butThem_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.S)
            {
                butEdit_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.H)
            {
                butHuy_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.K)
            {
                butKetThuc_Click(null, null);
            }
        }

        private void cbo_chibodt_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_tocdoan_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_todoan_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_dagcvvq_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_doanthecvvq_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_cqcvvq_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_dagcvht_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_doanthecvht_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void cbo_cqcvht_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");	
        }

        private void txtDang_DT_TextChanged(object sender, EventArgs e)
        {
            if (txtDang_DT.Text == "R")
            {
                cbo_chibodt.Enabled = true;
                txtSTD_DT.Enabled = true;
                txtNDB_DT.Enabled = true;
                txtNCT_DT.Enabled = true;

                cboDTCT_DT.Enabled = true;
                txtNTN_DT.Enabled = true;
                txtnoiCDi_DT.Enabled = true;
                txtNCDi_DT.Enabled = true;
                txtNCD_DT.Enabled = true;
                txtNoiCD_DT.Enabled = true;
   
                
            }
            if (txtDang_DT.Text == "C")
            {
                cbo_chibodt.Enabled = false;
                txtSTD_DT.Enabled = false;
                txtNDB_DT.Enabled = false;
                txtNCT_DT.Enabled = false;
                cboDTCT_DT.Enabled = false;
                txtNTN_DT.Enabled = false;
                txtnoiCDi_DT.Enabled = false;
                txtNCDi_DT.Enabled = false;
                txtNCD_DT.Enabled = false;
                txtNoiCD_DT.Enabled = false;

               

                cbo_chibodt.Text = "";
                txtSTD_DT.Text = "";
                txtNDB_DT.Text = "";
                txtNCT_DT.Text = "";
              
                txtNTN_DT.Text = "";
                txtnoiCDi_DT.Text = "";
                txtNCDi_DT.Text = "";
                txtNCD_DT.Text = "";
                txtNoiCD_DT.Text = "";
                cboDTCT_DT.SelectedIndex = -1;

            }
            if (txtDang_DT.Text == "")
            {
                cbo_chibodt.Enabled = false;
                txtSTD_DT.Enabled = false;
                txtNDB_DT.Enabled = false;
                txtNCT_DT.Enabled = false;

                cboDTCT_DT.Enabled = false;
                txtNTN_DT.Enabled = false;
                txtnoiCDi_DT.Enabled = false;
                txtNCDi_DT.Enabled = false;
                txtNCD_DT.Enabled = false;
                txtNoiCD_DT.Enabled = false;

              
                cboDTCT_DT.SelectedIndex = -1;

                txtSTD_DT.Text = "";
                txtNDB_DT.Text = "";
                txtNCT_DT.Text = "";
                cboDTCT_DT.Text = "";
                txtNTN_DT.Text = "";
                txtnoiCDi_DT.Text = "";
                txtNCDi_DT.Text = "";
                txtNCD_DT.Text = "";
                txtNoiCD_DT.Text = "";

                
            }
           
        }

        private void txtCD_DT_TextChanged(object sender, EventArgs e)
        {
            if (txtCD_DT.Text == "R")
            {
                cbo_tocdoan.Enabled = true;
                txtST1_DT.Enabled = true;
                txtNKN_DT.Enabled = true;
                txtCDP_DT.Enabled = true;
               
            }
            if (txtCD_DT.Text == "C")
            {
                cbo_tocdoan.Enabled = false;
                txtST1_DT.Enabled = false;
                txtNKN_DT.Enabled = false;
                txtCDP_DT.Enabled = false;
                cbo_tocdoan.Text= "";
                txtST1_DT.Text = "";
                txtNKN_DT.Text = "";
                txtCDP_DT.Text = "";
            }
            if (txtCD_DT.Text == "")
            {
                cbo_tocdoan.Enabled = false;
                txtST1_DT.Enabled = false;
                txtNKN_DT.Enabled = false;
                txtCDP_DT.Enabled = false;
                cbo_tocdoan.Text = "";
                txtST1_DT.Text = "";
                txtNKN_DT.Text = "";
                txtCDP_DT.Text = "";
            }
        }

        private void txtDoan_DT_TextChanged(object sender, EventArgs e)
        {
            if (txtDoan_DT.Text == "R")
            {
                cbo_todoan.Enabled = true;
                txtST2_DT.Enabled = true;
                txtNVD_DT.Enabled = true;
                txtNCDen_DT.Enabled = true;
                txtDP_DT.Enabled = true;
            }
            if (txtCD_DT.Text == "C")
            {
                cbo_todoan.Enabled = false;
                txtST2_DT.Enabled = false;
                txtNVD_DT.Enabled = false;
                txtNCDen_DT.Enabled = false;
                txtDP_DT.Enabled = false;

                cbo_todoan.Text = "";
                txtST2_DT.Text = "";
                txtNVD_DT.Text = "";
                txtNCDen_DT.Text = "";
                txtDP_DT.Text = "";
            }
            if (txtCD_DT.Text == "")
            {
                cbo_todoan.Enabled = false;
                txtST2_DT.Enabled = false;
                txtNVD_DT.Enabled = false;
                txtNCDen_DT.Enabled = false;
                txtDP_DT.Enabled = false;

                cbo_todoan.Text = "";
                txtST2_DT.Text = "";
                txtNVD_DT.Text = "";
                txtNCDen_DT.Text = "";
                txtDP_DT.Text = "";
            }
        }     
    }
}
